24 May '13 - 21:00 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: How to get the channel length in vb.net??  (Read 743 times)
i00
Posts: 27


« on: 2 Dec '09 - 23:35 »
Reply with quoteQuote

I was wondering how I would get the length of a channel in seconds.

I have tried the code below but the message box says: -10084943413446.2 where it should say something like: 204.something

   Public Const BASS_POS_BYTE As Integer = 0

    <DllImport("%PATH%\bass.dll")> _
    Public Shared Function BASS_ChannelBytes2Seconds(ByVal handle As Integer, pos As Integer) As Double
    End Function

    <DllImport("%PATH%\bass.dll")> _
    Public Shared Function BASS_ChannelGetLength(ByVal handle As Integer, ByVal mode As Integer) As Integer
    End Function

...

       Dim LengthB As Integer = BASSAPI.BASS_ChannelGetLength(hStream, BASSAPI.BASS_POS_BYTE)
        Msgbox(BASS_ChannelBytes2Seconds(hStream, LengthB))

...

Thanks
Kris
« Last Edit: 4 Dec '09 - 16:31 by i00 » Logged
Ian @ un4seen
Administrator
Posts: 15276


« Reply #1 on: 3 Dec '09 - 16:09 »
Reply with quoteQuote

Note that the BASS_ChannelBytes2Seconds "pos" parameter should be 64-bit (QWORD), which I think is "long" in .NET. The same goes for the BASS_ChannelGetLength return value.
Logged
i00
Posts: 27


« Reply #2 on: 4 Dec '09 - 16:30 »
Reply with quoteQuote

thanks works like a charm  Wink
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines