Creates a sample stream from a WebM or Matroska file.
HSTREAM BASS_WEBM_StreamCreateFile(
DWORD filetype,
void *file,
QWORD offset,
QWORD length,
DWORD flags,
DWORD track
);
| filetype | One of the following.
| ||||||||||||||||
| file | The file as described by filetype. | ||||||||||||||||
| offset | File offset to begin reading from. | ||||||||||||||||
| length | Maximum read length... 0 = to the end of the file. | ||||||||||||||||
| flags | A combination of these flags.
| ||||||||||||||||
| track | The audio track to play from the file... 1 = first, 0 = first playable track. When requesting the first playable track, all tracks will be checked in numerical order until a playable one is found. Non-audio tracks are ignored (not counted). |
| BASS_ERROR_INIT | BASS_Init has not been successfully called. |
| BASS_ERROR_NOTAVAIL | The BASS_STREAM_AUTOFREE flag cannot be combined with the BASS_STREAM_DECODE flag. |
| BASS_ERROR_ILLPARAM | filetype and/or length is invalid. length cannot be 0 when streaming from memory. |
| BASS_ERROR_FILEOPEN | The file could not be opened. |
| BASS_ERROR_FILEFORM | The file's format is not recognised/supported. |
| BASS_ERROR_TRACK | track is invalid. |
| BASS_ERROR_NOTAUDIO | The file does not contain audio, or it also contains video and videos are disabled. |
| BASS_ERROR_CODEC | The file uses a codec that is not available/supported. |
| 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! |
WebM and Matroska files can have tags for the file as a whole and for individual tracks. When present, they are available as a series of null-terminated UTF-8 strings from BASS_ChannelGetTags with BASS_TAG_WEBM and BASS_TAG_WEBM_TRACK, respectively. In the case of BASS_TAG_WEBM_TRACK, the active track's tags are given. When the Vorbis codec is used, BASS_TAG_OGG tags may also be available.
A single track from the file will be played by default, but if there are multiple audio tracks then BASS_ChannelSetPosition can be used with the BASS_POS_TRACK "mode" to change track (0 = first) and go to the start of it. The new track can use a different codec but it must have the same decoded sample format, otherwise the call will fail with a BASS_ERROR_FORMAT error and a new stream will need to be created for the track instead. The BASS_POS_TRACK "mode" can also be used with BASS_ChannelGetLength and BASS_ChannelGetPosition to get the number of audio tracks and the current track, respectively.
The stream's ctype value from BASS_ChannelGetInfo refers to the active track's decoder, so it does not identify a WebM or Matroska stream; the BASS_ATTRIB_WEBM attribute can be used for that.
Unless a specific track is requested in the track parameter, this function obeys the BASS_CONFIG_VIDEO option setting and will fail (BASS_ERROR_NOTAUDIO) if the file contains any video tracks when configured to do so.
BASS_ChannelGetInfo, BASS_ChannelGetLength, BASS_ChannelGetTags, BASS_ChannelPlay, BASS_ChannelSetAttribute, BASS_ChannelSetDSP, BASS_ChannelSetFX, BASS_StreamFree, BASS_StreamGetFilePosition