BASS_WMA_EncodeOpenNetworkMulti
Initializes WMA encoding to the network, using multiple bitrates.
HWMENCODE BASS_WMA_EncodeOpenNetworkMulti(
DWORD freq,
DWORD chans,
DWORD flags,
DWORD *bitrates,
DWORD port,
DWORD clients
);
Parameters
freq | The sample rate, or a BASS channel handle if the BASS_WMA_ENCODE_SOURCE flag is specified.
|
chans | The number of channels. More than stereo requires WMA Pro or PCM.
|
flags | A combination of these flags.
BASS_SAMPLE_8BITS | 8-bit sample data. If neither this or the BASS_SAMPLE_FLOAT flags are specified, then 16-bit data is expected.
| BASS_SAMPLE_FLOAT | 32-bit floating-point sample data.
| BASS_WMA_ENCODE_SOURCE | Use the BASS channel with the handle in freq as the encoder's source. The chans parameter is ignored, as are the BASS_SAMPLE_8BITS and BASS_SAMPLE_FLOAT flags. If the BASSenc add-on is loaded, then the BASS_CONFIG_ENCODE_PRIORITY setting is used to determine where in the channel's DSP chain the encoding is performed, otherwise priority -1000 is used.
| BASS_WMA_ENCODE_STANDARD | Use standard WMA encoding. If neither this or the BASS_WMA_ENCODE_PRO flag (nor the BASS_WMA_ENCODE_PCM flag) is specified, then either WMA codec could be used, depending on which supports the requested sample format and bitrate.
| BASS_WMA_ENCODE_PRO | Use WMA Pro encoding.
| BASS_WMA_ENCODE_PCM | Write uncompressed PCM data in an ASF container. The bitrates content is ignored except that it should be non-0.
| BASS_WMA_ENCODE_24BIT | Encode in 24-bit, else 16-bit. 24-bit encoding requires WMA Pro or PCM.
| BASS_WMA_ENCODE_SCRIPT | Enable the specification of tags mid-stream (after encoding has begun). |
|
bitrates | Array of encoding bitrates to use, terminated with a 0.
|
port | The port number for clients to connect to... 0 = let the system choose a port.
|
clients | The maximum number of clients (up to 50) that can be connected.
|
Return value
If successful, the new encoder's handle is returned, else FALSE is returned. Use
BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_WMA | The Windows Media modules (v9 or above) are not installed.
|
BASS_ERROR_ILLPARAM | clients is invalid.
|
BASS_ERROR_NOTAVAIL | No codec could be found to support the requested sample format and bitrate.
|
BASS_ERROR_UNKNOWN | Some other mystery problem!
|
Remarks
This function is identical to
BASS_WMA_EncodeOpenNetwork, but with the additional ability to specify multiple bitrates.
When encoding/broadcasting in multiple bitrates, the user will automatically get the best available bitrate for their bandwidth.
Example
Initialize encoding 44100hz 16-bit stereo sample data at 128kb/s and 64kb/s, using a system-chosen port, and allowing up to 5 clients.
DWORD bitrates[3]={128000,64000,0}; // the bitrates
HWMENCODE encoder=BASS_WMA_EncodeOpenNetworkMulti(44100, 2, 0, bitrates, 0, 5);
See also
BASS_WMA_EncodeOpenNetwork