BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_StreamCreateDevice Method BASS.NET API for the Un4seen BASS Audio Library
Create a "dummy" stream for the device's final output mix (using the STREAMPROC_DEVICE option).

Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.13.3
Syntax

public static int BASS_StreamCreateDevice(
	int freq,
	int chans,
	BASSFlag flags,
	IntPtr user
)

Parameters

freq
Type: SystemInt32
Ignored.
chans
Type: SystemInt32
Ignored.
flags
Type: Un4seen.BassBASSFlag
Ignored.
user
Type: SystemIntPtr
User instance data to pass to the callback function.

Return Value

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

This allows DSP/FX to be applied to all channels that are playing on the device, rather than individual channels. DSP/FX parameter change latency is also reduced because channel playback buffering is avoided. The stream is created with the device's current output sample format; the freq, chans, and flags parameters are ignored. It will always be floating-point except on platforms/architectures that do not support floating-point (see BASS_CONFIG_FLOAT), where it will be 16-bit instead.

Each device has a single final output mix stream, which can be used to apply DSP/FX to the device output. Multiple requests for a final output mix stream (using STREAMPROC_DEVICE) on the same device will receive the same stream handle, which cannot be freed via BASS_StreamFree(Int32). It will automatically be freed if the device's output format (sample rate or channel count) changes. A BASS_SYNC_FREE sync can be set via BASS_ChannelSetSync(Int32, BASSSync, Int64, SYNCPROC, IntPtr) to be notified when this happens, at which point a new stream with the device's new format could be created.

ERROR CODEDescription
BASS_ERROR_INITBASS_Init(Int32, Int32, BASSInit, IntPtr, IntPtr) has not been successfully called.
BASS_ERROR_NOTAVAILOnly decoding channels (BASS_STREAM_DECODE) are allowed when using the "no sound" device. The BASS_STREAM_AUTOFREE flag is also unavailable to decoding channels.
BASS_ERROR_FORMATThe sample format is not supported by the device/drivers. If the stream is more than stereo or the BASS_SAMPLE_FLOAT flag is used, it could be that they are not supported.
BASS_ERROR_SPEAKERThe specified SPEAKER flags are invalid. The device/drivers do not support them, they are attempting to assign a stereo stream to a mono speaker or 3D functionality is enabled.
BASS_ERROR_MEMThere is insufficient memory.
BASS_ERROR_NO3DCould not initialize 3D support.
BASS_ERROR_UNKNOWNSome other mystery problem!

Platform-specific

The STREAMPROC_DEVICE option is not available when using DirectSound output on Windows because BASS does not produce the final output mix then.

See Also

Reference