BASS_WMA_EncodeOpenPublish
Initializes WMA encoding to a publishing point on a Windows Media server.
HWMENCODE BASS_WMA_EncodeOpenPublish(
DWORD freq,
DWORD chans,
DWORD flags,
DWORD bitrate,
char *url,
char *user,
char *pass
);
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_VOICE or BASS_WMA_ENCODE_PCM flags) 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_VOICE | Use WMA voice encoding.
| BASS_WMA_ENCODE_VOICE_MIXED | Use WMA voice encoding in mixed mode.
| BASS_WMA_ENCODE_PCM | Write uncompressed PCM data in an ASF container. bitrate is ignored.
| 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).
| BASS_UNICODE | url, user and pass are Unicode (UTF-16). |
|
bitrate | The encoding bitrate.
|
url | URL of the publishing point on the Windows Media server.
|
user | Username to use in connecting to the server... if either this or pass is NULL, then no username/password is sent to the server.
|
pass | Password to use in connecting to the server.
|
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_NOTAVAIL | No codec could be found to support the requested sample format and bitrate.
|
BASS_ERROR_FILEOPEN | Could not connect to the server.
|
BASS_ERROR_WMA_DENIED | Access was denied. Check the user and pass.
|
BASS_ERROR_WMA_PUBINIT | The server connection was not initialized properly. This can happen when connecting to the same server multiple times in quick succession. Try again after waiting a couple of seconds.
|
BASS_ERROR_UNKNOWN | Some other mystery problem!
|
Remarks
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 to retrieve a list of the encoding bitrates available for a specific sample format. VBR encoding is not recommended for network encoding.
Use BASS_WMA_EncodeSetTag to set tags, BASS_WMA_EncodeWrite to encode sample data, and BASS_WMA_EncodeClose to finish encoding and close the connection to the server. If the BASS_WMA_ENCODE_SOURCE flag is used and the source BASS channel is freed then the encoder will be closed automatically.
The BASS_WMA_ENCODE_QUEUE flag is not necessary with this function as the data is always queued and fed to the encoder asynchronously.
See also
BASS_WMA_EncodeClose, BASS_WMA_EncodeGetRates, BASS_WMA_EncodeOpen, BASS_WMA_EncodeOpenFile, BASS_WMA_EncodeOpenNetwork, BASS_WMA_EncodeOpenPublishMulti, BASS_WMA_EncodeSetTag, BASS_WMA_EncodeWrite