BASS.NET API for the Un4seen BASS Audio Library

BassBASS_StreamFree Method

BASS.NET API for the Un4seen BASS Audio Library
Frees a sample stream's resources, including any SYNC/DSP/FX it has.

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

[DllImportAttribute("bass")]
public static bool BASS_StreamFree(
	int handle
)

Parameters

handle
Type: SystemInt32
The stream handle.

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function can be used to free all types of channel, instead of using either BASS_StreamFree(Int32) or BASS_MusicFree(Int32) or BASS_ChannelStop(Int32) depending on the channel type.

Channel freeing may be blocked by BASS_ChannelLock(Int32, Boolean) and BASS_ChannelRef(Int32, Boolean). When that happens, the channel will be immediately stopped (if playing) and invalidated, but only freed when eventually unblocked by those functions; other function calls on it will fail with a BASS_ERROR_FREEING error. If the channel is locked to the current thread or its reference count is not 0, then the channel will be freed asynchronously (in another thread) once unblocked. The channel will also be freed asynchronously if this function is called from within a callback function where it would otherwise cause a crash.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_FREEINGThe stream is already being freed.
BASS_ERROR_NOTAVAILDevice streams (STREAMPROC_DEVICE) cannot be freed.

See Also

Reference