BASS.NET API for the Un4seen BASS Audio LibraryBassBASS_Free Method BASS.NET API for the Un4seen BASS Audio Library
Frees all resources used by the output device, including all it's samples, streams, and MOD musics.

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

[DllImportAttribute("bass.dll", CharSet = CharSet.Unicode)]
public static bool BASS_Free()

Return Value

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

This function should be called for all initialized devices before your program exits. It's not necessary to individually free the samples/streams/musics as these are all automatically freed by this function.

When using multiple devices, the current thread's device setting (as set with BASS_SetDevice(Int32)) determines which device this function call applies to.

ERROR CODEDescription
BASS_ERROR_INITBASS_Init(Int32, Int32, BASSInit, IntPtr, IntPtr) has not been successfully called.

Examples

VB
' init device 1 and 2
Bass.BASS_Init(1, 44100, BASSInit.BASS_DEVICE_DEFAULT, Me.Handle)
Bass.BASS_Init(2, 44100, BASSInit.BASS_DEVICE_DEFAULT, Me.Handle)
...
' create the stream for device 1
Bass.BASS_SetDevice(1)
Dim stream As Integer = Bass.BASS_StreamCreateFile("afile.mp3", 0, 0, BASSFlag.BASS_DEFAULT)
' create the stream for device 2
Bass.BASS_SetDevice(2)
Dim stream As Integer = Bass.BASS_StreamCreateFile("afile.mp3", 0, 0, BASSFlag.BASS_DEFAULT)
...
' free any initialized device
Bass.BASS_SetDevice(1)
Bass.BASS_Free()
Bass.BASS_SetDevice(2)
Bass.BASS_Free()
// init device 1 and 2
Bass.BASS_Init(1, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle);
Bass.BASS_Init(2, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle);
...
// create the stream for device 1
Bass.BASS_SetDevice(1);
int stream = Bass.BASS_StreamCreateFile("afile.mp3", 0, 0, BASSFlag.BASS_DEFAULT);
...
// create the stream for device 2
Bass.BASS_SetDevice(2);
int stream = Bass.BASS_StreamCreateFile("afile.mp3", 0, 0, BASSFlag.BASS_DEFAULT);
...
// free any initialized device
Bass.BASS_SetDevice(1);
Bass.BASS_Free();
Bass.BASS_SetDevice(2);
Bass.BASS_Free();
See Also

Reference