Retrieves the WMA encoding bitrates available for a specified sample format.
DWORD *BASS_WMA_EncodeGetRates( DWORD freq, DWORD chans, DWORD flags );
freq | The sample rate, or a BASS channel handle if the BASS_WMA_ENCODE_SOURCE flag is specified. | ||||||||||
chans | The number of channels. | ||||||||||
flags | A combination of these flags.
|
BASS_ERROR_WMA | The Windows Media modules (v9 or above) are not installed. |
BASS_ERROR_NOTAVAIL | No codec could be found to support the specified sample format. |
BASS_ERROR_UNKNOWN | Some other mystery problem! |
The WMA codec expects 16-bit or 24-bit sample data depending on the BASS_WMA_ENCODE_24BIT flag, but BASSWMA will accept 8-bit, 16-bit or floating-point data, and convert it to the appropriate format. Of course, it makes little sense to encode 8-bit or 16-bit data in 24-bit.
The WMA codec currently supports the following sample rates: 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000. And the following number of channels: 1, 2, 6, 8. But not all combinations of these are supported. To encode other sample formats, the data will first have to be resampled to a supported format.
WMA Pro gives better quality than the standard WMA codec. Support for multi-channel (more than stereo) and 24-bit encoding is also only available with WMA Pro.
DWORD *rates=BASS_WMA_EncodeGetRates(44100, 2, 0); // get a pointer to the available bitrates if (rates) while (*rates) { printf("%d\n", *rates); // display the rate rates++; // move on to the next rate }