Sets up an Opus encoder on a channel.
|handle||The channel handle... a HSTREAM, HMUSIC, or HRECORD.
|options||Encoder options... NULL = use defaults. The following OPUSENC style options are supported: --bitrate, --vbr, --cvbr, --hard-cbr, --comp / --complexity, --framesize, --expect-loss, --max-delay, --serial, --comment, --artist, --title, --album, --date, --genre, --padding. Anything else that is included will be ignored. See the OPUSENC documentation for details on the aforementioned options and defaults.
|flags||A combination of these flags.|
|BASS_ENCODE_QUEUE||Queue data to feed the encoder asynchronously. This prevents the data source (DSP system or BASS_Encode_Write call) getting blocked by the encoder, but if data is queud more quickly than the encoder can process it, that could result in lost data.
|BASS_ENCODE_LIMIT||Limit the encoding rate to real-time speed, by introducing a delay when the rate is too high. With BASS 2.4.6 or above, this flag is ignored when the encoder is fed in a playback buffer update cycle (including BASS_Update and BASS_ChannelUpdate calls), to avoid possibly causing playback buffer underruns. Except for in those instances, this flag is applied automatically when the encoder is feeding a Shoutcast or Icecast server.
|BASS_ENCODE_CAST_NOLIMIT||Don't limit the encoding rate to real-time speed when feeding a Shoutcast or Icecast server. This flag overrides the BASS_ENCODE_LIMIT flag.
|BASS_ENCODE_PAUSE||Start the encoder in a paused state.
|BASS_ENCODE_AUTOFREE||Automatically free the encoder when the source channel is freed. If queuing is enabled, any remaining queued data will be sent to the encoder before it is freed.
|BASS_UNICODE||options is in UTF-16 form. Otherwise it should be UTF-8.
|proc||Optional callback function to receive the encoded data... NULL = no callback.
|user||User instance data to pass to the callback function.
The encoder handle is returned if the encoder is successfully started, else 0 is returned. Use BASS_ErrorGetCode
to get the error code.
|BASS_ERROR_HANDLE||handle is not valid.
|BASS_ERROR_FORMAT||The channel's sample format is not supported by the encoder.
|BASS_ERROR_UNKNOWN||Some other mystery problem!
is used internally to apply the encoder to the source channel, so the remarks in its documentation also apply to this function.
Tags/comments should be in UTF-8 form. This function will take care of that when the BASS_UNICODE flag is used, but otherwise you will need to make sure that any tags included in options are UTF-8 (not ISO-8859-1/etc).
On Windows and Linux, an SSE supporting CPU is required for sample rates other than 48000/24000/16000/12000/8000 Hz.
BASS_Encode_CastInit, BASS_Encode_IsActive, BASS_Encode_ServerInit, BASS_Encode_SetNotify, BASS_Encode_SetPaused, BASS_Encode_Stop, BASS_Encode_Write, ENCODEPROC callback, BASS_CONFIG_ENCODE_PRIORITY