Set new values for beat detection parameters.
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_BeatSetParameters( int handle, float bandwidth, float centerfreq, float beat_rtime )
Parameters
- handle
- Type: SystemInt32
Stream/music/wma/cd/any other supported add-on format. - bandwidth
- Type: SystemSingle
Bandwidth in Hz between 0 and samplerate/2 (-1.0f = leave current, default is 10Hz). - centerfreq
- Type: SystemSingle
The center-frequency in Hz of the band pass filter between 0 and samplerate/2 (-1.0f = leave current, default is 90Hz). - beat_rtime
- Type: SystemSingle
Beat release time in ms. (-1.0f = leave current, default is 20ms).
Return Value
Type: BooleanIf successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
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); BassFx.BASS_FX_BPM_BeatSetParameters(stream, 20f, 110f, 24f); Bass.BASS_ChannelPlay(stream, false); ... private void MyBeatProc(int channel, double beatpos, IntPtr user) { Console.WriteLine("Beat at: {0}", beatpos); }
See Also