BASS_OPUS_StreamCreate
Creates a sample stream from raw Opus packets.
HSTREAM BASS_OPUS_StreamCreate(
BASS_OPUS_HEAD *head,
DWORD flags,
STREAMPROC *proc,
void *user
);
Parameters
head | Decoder initialization parameters.
|
flags | A combination of these flags.
BASS_SAMPLE_FLOAT | Use 32-bit floating-point sample data. See Floating-point channels for info. If this flag is not specified, then the stream is 16-bit.
| BASS_SAMPLE_3D | Enable 3D functionality. The stream must be mono (chans=1). The SPEAKER flags cannot be used together with this flag.
| BASS_STREAM_AUTOFREE | Automatically free the stream when playback ends.
| BASS_STREAM_DECODE | Decode the sample data, without playing it. Use BASS_ChannelGetData to retrieve decoded sample data. The BASS_SAMPLE_3D, BASS_STREAM_AUTOFREE and SPEAKER flags cannot be used together with this flag.
| BASS_SPEAKER_xxx | Speaker assignment flags. These flags have no effect when the stream is more than stereo.
|
|
proc | The user defined stream writing function, or one of the following.
|
user | User instance data to pass to the callback function. Unused when creating a dummy or push stream.
|
Return value
If successful, the new stream's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
Error codes
BASS_ERROR_INIT | BASS_Init has not been successfully called.
|
BASS_ERROR_ILLPARAM | head and/or proc is invalid.
|
BASS_ERROR_NOTAVAIL | The BASS_STREAM_AUTOFREE flag cannot be combined with the BASS_STREAM_DECODE flag.
|
BASS_ERROR_FORMAT | The sample format is not supported.
|
BASS_ERROR_SPEAKER | The specified SPEAKER flags are invalid.
|
BASS_ERROR_MEM | There is insufficent memory.
|
BASS_ERROR_NO3D | Could not initialize 3D support.
|
BASS_ERROR_UNKNOWN | Some other mystery problem!
|
Remarks
This function allows streaming of Opus packets without an Ogg container. When a STREAMPROC callback function is used, it should return one whole packet of data with each call, or 0 if there are none currently available. When STREAMPROC_PUSH is used, the packets should be provided via BASS_OPUS_StreamPutData. In both cases, the BASS_STREAMPROC_OPUS_LOSS value can be used to indicate a missing packet, which will activate packet loss concealment to fill the gap. FEC (Forward Error Correction) will be used when it has been enabled by the encoder.
To stream a standard Opus file, use BASS_OPUS_StreamCreateFile.
See also
BASS_OPUS_StreamCreateFile, BASS_OPUS_StreamCreateFileUser, BASS_OPUS_StreamCreateURL
BASS_ChannelGetInfo, BASS_ChannelGetLength, BASS_ChannelGetTags, BASS_ChannelPlay, BASS_ChannelSetAttribute, BASS_ChannelSetDSP, BASS_ChannelSetFX, BASS_StreamFree, BASS_StreamGetFilePosition