ENCODEPROCEX callback


User defined callback function to process encoded sample data.

void CALLBACK EncodeProcEx(
    HENCODE handle,
    DWORD channel,
    const void *buffer,
    DWORD length,
    DWORD offset,
    void *user
);

Parameters

handleThe encoder that the data is from.
channelThe channel that the encoder is set on.
bufferBuffer containing the encoded data.
lengthThe number of bytes in the buffer.
offsetFile offset of the data.
userThe 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, const 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.

See also

BASS_Encode_StartCA