ENCODEPROCEX callback
User defined callback function to process encoded sample data.
void CALLBACK EncodeProcEx(
HENCODE handle,
DWORD channel,
void *buffer,
DWORD length,
DWORD offset,
void *user
);
Parameters
| handle | The encoder that the data is from. |
| channel | The channel that the encoder is set on. |
| buffer | Buffer containing the encoded data. |
| length | The number of bytes in the buffer. |
| offset | File offset of the data. |
| user | The user instance data given when BASS_Encode_StartCA was called. |
Example
A callback function to write the encoded data to to a file.
void CALLBACK MyFileWriter(HENCODE handle, DWORD channel, void *buffer, DWORD length, DWORD offset, void *user)
{
FILE *file=(FILE*)user;
fseek(file, offset, SEEK_SET); // seek to file offset
fwrite(buffer, 1, length, file); // write the data
}
NOTE: This is just an example. It is simpler to use BASS_Encode_StartCAFile to encode to a file.