BASS.NET API for the Un4seen BASS Audio Library

BassWebMBASS_WEBM_StreamCreateFile Method (IntPtr, Int64, Int64, BASSFlag, Int32)

BASS.NET API for the Un4seen BASS Audio Library
Creates a sample stream from a WebM memory IntPtr.

This overload implements streaming from memory.

Namespace:  Un4seen.Bass.AddOn.WebM
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.7
Syntax

public static int BASS_WEBM_StreamCreateFile(
	IntPtr memory,
	long offset,
	long length,
	BASSFlag flags,
	int track
)

Parameters

memory
Type: SystemIntPtr
An unmanaged pointer to the memory location as an IntPtr.
offset
Type: SystemInt64
Offset to begin streaming from (unused for memory streams, set to 0).
length
Type: SystemInt64
Data length (needs to be set to the length of the memory streams in bytes which should be played).
flags
Type: Un4seen.BassBASSFlag
Any combination of these flags: see BASSFlag.
BASS_WEBM_DOPProduce DSD-over-PCM data (with 0x05/0xFA markers). DSD-over-PCM data is 24-bit, so the BASS_SAMPLE_FLOAT flag is required.
BASS_WEBM_RAWProduce raw WebM data instead of PCM. The WebM data is in blocks of 8 bits (1 byte) per-channel with the MSB being first/oldest. WebM data is not playable by BASS, so the BASS_STREAM_DECODE flag is required.
track
Type: SystemInt32
The 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. The active track is available via the BASS_ATTRIB_WEBM_TRACK attribute.

Return Value

Type: Int32
If successful, the new stream's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

Works almost in the same way BASS_StreamCreateFile(String, Int64, Int64, BASSFlag) does - so for details look there.

WebM is a subset of the Matroska file format. WebM files can contain Vorbis or Opus audio data, while Matroska also supports other codecs including AAC / AC3 / MP3. BASS includes support for Vorbis and MP3, and AAC on some platforms, but add-ons are required (loaded via BASS_PluginLoad) to support other codecs, eg. BASSOPUS for Opus. Not all Matroska features are supported but most Matroska files should be playable.

To stream a file from the internet, use BASS_WEBM_StreamCreateURL(String, Int32, BASSFlag, DOWNLOADPROC, IntPtr, Int32). To stream from other locations, see BASS_WEBM_StreamCreateFileUser(BASSStreamSystem, BASSFlag, BASS_FILEPROCS, IntPtr, Int32).

See Also

Reference