Author Topic: VB 2008 BPM Question  (Read 4953 times)

0 Members and 1 Guest are viewing this topic.

Offline Bckspc

  • Posts: 3
    • View Profile
VB 2008 BPM Question
« on: January 14, 2009, 03:58:29 AM »
Hi :)

Is it possible to use this with VB2008?
Sorry if it is a simple question  am only young and just learning VB :)

Thanks
Bckspc :)

Offline (: JOBnik! :)

  • Administrator
  • *****
  • Posts: 44
  • Gender: Male
    • View Profile
    • (: JOBnik! :)
Re: VB 2008 BPM Question
« Reply #1 on: January 14, 2009, 11:26:39 AM »
Hi ;D

Of course you can use it in VB2008 or any other programming language as well, even in OSX and Linux :)
To use it with .Net, please take a look on BASS page for BASS.NET API:
http://www.un4seen.com/bass.html#apis
Have fun!
8) JOBnik! 8)

Offline Bckspc

  • Posts: 3
    • View Profile
Re: VB 2008 BPM Question
« Reply #2 on: January 14, 2009, 11:34:07 PM »
Thanks for the reply :)
I am only new to VB so still working my way through it.
Backspc :)

Offline Bckspc

  • Posts: 3
    • View Profile
Re: VB 2008 BPM Question
« Reply #3 on: January 15, 2009, 01:45:44 AM »
Hi JOBnik,  :D

I am having a bit of trouble understanding how to use this, the samples I have tried are for VB06 and don't convert correctly (and I don't know enough to fix them :(). I have posted a question on Un4seen Developments Forum > Developments > BASS > Topic: Help with VB 2008. but am still having trouble. Could you please point me in the right direction, if you could?
All I want is to get the bpm of a mp3 or mpeg and display the results in a text box. It all sound so simple, but I am struggling with this.

Thanks
Bckspc :)

Offline (: JOBnik! :)

  • Administrator
  • *****
  • Posts: 44
  • Gender: Male
    • View Profile
    • (: JOBnik! :)
Re: VB 2008 BPM Question
« Reply #4 on: January 18, 2009, 02:46:21 PM »
Hi ;D

Get BPM from decoded stream:
Code: [Select]
Dim bpmHandle As Long, bpmDecode As Single

' create decode stream
bpmHandle = BASS_StreamCreateFile(BASSFALSE, StrPtr(filename), 0, 0, BASS_STREAM_DECODE)

' get bpm value from position 0 to position 30 (in seconds)
bpmDecode = BASS_FX_BPM_DecodeGet(bpmHandle, 0, 30, 0, BASS_FX_BPM_BKGRND Or BASS_FX_FREESOURCE, 0)

' free decode bpm and stream handles
Call BASS_FX_BPM_Free(bpmHandle)

Get BPM in real-time after chosen period of seconds:
Code: [Select]
' set bpm callback to trigger after 10 seconds
Call BASS_FX_BPM_CallbackSet(chan, AddressOf GetBPM_Callback, 10, 0, 0, 0)

' remove bpm callback from stream handle
Call BASS_FX_BPM_Free(chan)

' callback function to get the bpm after period of time
Public Sub GetBPM_Callback(ByVal handle As Long, ByVal bpm As Single, ByVal user As Long)
   textbox.text = bpm
End Sub
Have fun!
8) JOBnik! 8)