Starts recording with a predefined BASSRecordProc.
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.18.0
Syntax
public static int BASS_RecordStart( int freq, int chans, BASSFlag flags, BASSRecordProc proc, IntPtr user )
Parameters
- freq
- Type: SystemInt32
The sample rate to record at. - chans
- Type: SystemInt32
The number of channels... 1 = mono, 2 = stereo. - flags
- Type: Un4seen.BassBASSFlag
Any combination of these flags (see BASSFlag)BASS_SAMPLE_8BITS Use 8-bit resolution. If neither this or the BASS_SAMPLE_FLOAT flags are specified, then the recorded data is 16-bit. BASS_SAMPLE_FLOAT Use 32-bit floating-point sample data. WDM drivers are required to use this flag in Windows. See Floating-point channels for more information. BASS_RECORD_PAUSE Start the recording paused. Use BASS_ChannelPlay(Int32, Boolean) together with the handle returned by this method to start it. BASS_RECORD_OPENSLES Use OpenSL ES instead of AAudio on Android. If AAudio is not available (pre-Android 8.1) then this will be applied automatically. - proc
- Type: Un4seen.BassBASSRecordProc
Any of these predefined BASSRecordProc:RECORDPROC_NONE No function. The data is instead pulled from the recording via BASS_ChannelGetData(Int32, IntPtr, Int32). RECORDPROC_TRUE A function that only contains 'return true'. - user
- Type: SystemIntPtr
User instance data to pass to the callback function.
Return Value
Type: Int32If successful, the new recording's handle is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
When not using a callback function (RECORDPROC_NONE), the recorded data is instead retrieved via BASS_ChannelGetData(Int32, IntPtr, Int32). To keep latency at a minimum, the amount of data in the recording buffer should be monitored (also done via BASS_ChannelGetData, with the BASS_DATA_AVAILABLE flag) to check that there is not too much data; freshly recorded data will only be retrieved after the older data in the buffer is.
See Also