User defined callback function to process recorded sample data.
BOOL CALLBACK RecordProc(
HRECORD handle,
const void *buffer,
DWORD length,
void *user
);
| handle | The recording that the data is from. |
| buffer | Pointer to the recorded sample data. The sample data is in standard Windows PCM format, that is 8-bit samples are unsigned, 16-bit samples are signed, 32-bit floating-point samples range from -1 to +1. |
| length | The number of bytes in the buffer. |
| user | The user instance data given when BASS_RecordStart was called. |
BOOL CALLBACK MyRecordProc(HRECORD handle, const void *buffer, DWORD length, void *user)
{
fwrite(buffer, 1, length, (FILE*)user); // write the buffer to the file
return TRUE; // continue recording
}
...
HRECORD record = BASS_RecordStart(44100, 2, 0, MyRecordProc, file); // start recording