Assembly: Bass.Net (in Bass.Net.dll) Version: 220.127.116.11
[DllImportAttribute("bassmix")] public static int BASS_Mixer_ChannelGetData( int handle, float buffer, int length )
<DllImportAttribute("bassmix">] Public Shared Function BASS_Mixer_ChannelGetData ( handle As Integer, <OutAttribute> buffer As Single(), length As Integer ) As Integer
- Type: SystemInt32
The handle of the mixer source channel (which was add via BASS_Mixer_StreamAddChannel(Int32, Int32, BASSFlag) or BASS_Mixer_StreamAddChannel(Int32, Int32, BASSFlag) or BASS_Mixer_StreamAddChannelEx(Int32, Int32, BASSFlag, Int64, Int64)) beforehand).
- Type: SystemSingle
The array (float) to receive the data, use BASS_SAMPLE_FLOAT when creating the channel stream!
- Type: SystemInt32
Number of bytes wanted, and/or the following flags (BASSData):
BASS_DATA_FLOAT Return floating-point sample data. BASS_DATA_FFT256 256 sample FFT (returns 128 floating-point values) BASS_DATA_FFT512 512 sample FFT (returns 256 floating-point values) BASS_DATA_FFT1024 1024 sample FFT (returns 512 floating-point values) BASS_DATA_FFT2048 2048 sample FFT (returns 1024 floating-point values) BASS_DATA_FFT4096 4096 sample FFT (returns 2048 floating-point values) BASS_DATA_FFT8192 8192 sample FFT (returns 4096 floating-point values) BASS_DATA_FFT_INDIVIDUAL Use this flag to request separate FFT data for each channel. The size of the data returned (as listed above) is multiplied by the number channels. BASS_DATA_FFT_NOWINDOW This flag can be used to prevent a hanning window being applied to the sample data when performing an FFT. BASS_DATA_AVAILABLE Query the amount of data the channel has buffered. This flag is primarily of use when recording, and can't be used with decoding channels as they do not have playback buffers. buffer can be when using this flag.
Return ValueType: Int32
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code.
When requesting FFT data, the number of bytes read from the channel (to perform the FFT) is returned.
When requesting sample data, the number of bytes written to buffer will be returned (not necessarily the same as the number of bytes read when using the BASS_DATA_FLOAT flag).
When using the BASS_DATA_AVAILABLE flag, the number of bytes in the channel's buffer is returned.
This function is like the standard BASS_ChannelGetData(Int32, IntPtr, Int32), but it gets the data from the channel's buffer instead of decoding it from the channel, which means that the mixer doesn't miss out on any data. In order to do this, the source channel must have buffering enabled, via the BASS_MIXER_BUFFER flag.
If the mixer is being played by BASS, the returned data will be in sync with what is currently being heard from the mixer. If another output system is being used, the BASS_ATTRIB_MIXER_LATENCY option can be used to tell the mixer what the latency is so that it can be taken account of, otherwise the channel's most recent data will be returned. The BASS_CONFIG_MIXER_BUFFER config option determines how far back data will be available from, so it should be set high enough to cover any latency.
|BASS_ERROR_HANDLE||handle is not plugged into a mixer.|
|BASS_ERROR_NOTAVAIL||The channel does not have buffering (BASS_MIXER_BUFFER) enabled.|