Initializes WMA encoding to the network, using multiple bitrates.
Namespace: Un4seen.Bass.AddOn.Wma
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
[DllImportAttribute("basswma")] public static int BASS_WMA_EncodeOpenNetworkMulti( int freq, int chans, BASSWMAEncode flags, int[] bitrates, int port, int clients )
Parameters
- freq
- Type: SystemInt32
The sample rate in Hz, or a BASS channel handle if the BASS_WMA_ENCODE_SOURCE flag is specified. - chans
- Type: SystemInt32
The number of channels (1=mono, 2=stereo, etc.). - flags
- Type: Un4seen.Bass.AddOn.WmaBASSWMAEncode
Any combination of these flags (see BASSWMAEncode):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_STANDARD Use standard WMA encoding. If neither this or the BASS_WMA_ENCODE_PRO flag is specified, then either codec could be used (whichever supports the requested sample format and bitrate). BASS_WMA_ENCODE_PRO Use WMA Professional encoding. BASS_WMA_ENCODE_VOICE Use WMA voice encoding. BASS_WMA_ENCODE_VOICE_MIXED UUse WMA voice encoding in mixed mode. BASS_WMA_ENCODE_PCM Write uncompressed PCM data in an ASF container. bitrate 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. BASS_WMA_ENCODE_SCRIPT Enable the specification of tags mid-stream (after encoding has begun). BASS_WMA_ENCODE_SOURCE Use the BASS channel with the handle in freq as the encoder's source. The chansparameter 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. - bitrates
- Type: SystemInt32
Array of encoding bitrates (in bits per second, e.g. 128000) to use, terminated with a 0 element (so the number of elements in the array must be one more than the effective bitrates used). - port
- Type: SystemInt32
The port number for clients to conenct to... 0 = let the system choose a port. - clients
- Type: SystemInt32
The maximum number of clients (up to 50) that can be connected.
Return Value
Type: Int32If succesful, the new encoder's handle is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks
When encoding/broadcasting in multiple bitrates, the user will automatically get the best available bitrate for their bandwidth.
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. Use BASS_WMA_EncodeGetRates(Int32, Int32, BASSWMAEncode) to retrieve a list of the encoding bitrates available for a specific sample format. VBR encoding is not recommended for network encoding.
ERROR CODE | Description |
---|---|
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 specified sample format and bitrate. |
BASS_ERROR_UNKNOWN | Some other mystery problem! |
Examples
int[] bitrates = {128000, 64000, 0}; // the bitrates int encoder = BassWma.BASS_WMA_EncodeOpenNetworkMulti( 44100, 2, BASSWMAEncode.BASS_WMA_ENCODE_DEFAULT, bitrates, 4711, 5);
See Also