Enable getting Beat position in seconds in real-time.
Namespace: Un4seen.Bass.AddOn.Fx
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.2
Syntax
[DllImportAttribute("bass_fx")] public static bool BASS_FX_BPM_BeatCallbackSet( int handle, BPMBEATPROC proc, IntPtr user )
Parameters
- handle
- Type: SystemInt32
Stream/music/wma/cd/any other supported add-on format. - proc
- Type: Un4seen.Bass.AddOn.FxBPMBEATPROC
User defined function to receive the beat position values (see BPMBEATPROC). - user
- Type: SystemIntPtr
User instance data to pass to the callback function.
Return Value
Type: BooleanIf successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
BASS_FX_BPM_BeatFree(Int32) must be called at the end to free the real-time beat position callback and resources.
Note: You should call BASS_FX_BPM_BeatCallbackReset(Int32) after you have changed the position of the stream when called from a "mixtime" SYNCPROC.
ERROR CODE | Description |
---|---|
BASS_ERROR_HANDLE | handle is not valid. |
Examples
private BPMBEATPROC _beatProc; ... int stream = Bass.BASS_StreamCreateFile("test.mp3", 0L, 0L, BASSFlag.BASS_DEFAULT); _beatProc = new BPMBEATPROC(MyBeatProc); BassFx.BASS_FX_BPM_BeatCallbackSet(stream, _beatProc, IntPtr.Zero); Bass.BASS_ChannelPlay(stream, false); ... private void MyBeatProc(int channel, double beatpos, IntPtr user) { Console.WriteLine("Beat at: {0}", beatpos); }
See Also