Sets up an encoder on a channel, using an ACM codec and writing the output to a file.
|handle||The channel handle... a HSTREAM, HMUSIC, or HRECORD.
|form||ACM codec output format.
|flags||A combination of these flags.|
|BASS_ENCODE_NOHEAD||Don't write a WAVE header to the file.
|BASS_ENCODE_RF64||Write an RF64 header instead of a standard RIFF header, allowing the file to go beyond 4GB in size. This flag is ignored if the BASS_ENCODE_NOHEAD flag is used.
|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_PAUSE||Start the encoder paused.
|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||file is a Unicode (UTF-16) filename.
|file||The filename to write.
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_NOTAVAIL||The codec specified in form couldn't be initialized.
|BASS_ERROR_CREATE||The file could not be created.
|BASS_ERROR_UNKNOWN||Some other mystery problem!
This function is identical to BASS_Encode_StartACM
, except that it writes the encoded data to a file instead of a callback function.
Unless the BASS_ENCODE_NOHEAD flag is specified, a WAVE header and the form contents will be written to the file. This is generally required for the file to be playable, but in some cases (eg. MP3) it's not. Standard RIFF WAV files are limited to a little over 4GB in size, so BASSenc will automatically stop encoding at that point. That size limit can be overcome with an RF64 file. When writing an RF64 WAV file, a standard RIFF header will still be written initially, which will only be replaced by an RF64 header at the end if the file size has exceeded the standard limit.
This function is only available on Windows and Windows CE.
, ENCODEPROC callback