BASS.NET API for the Un4seen BASS Audio Library

BassBASS_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.17.5
Syntax

[DllImportAttribute("bass")]
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

// 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