gitlabEdit

speakersDevices

Sound device management in your hands!

The device tools shipped with the Basolia library allow you to manage your sound devices and your available sound drivers for MPG123.


Usage

You can use the following functions to manage your sound devices:

chevron-rightGetting drivershashtag

To get a list of drivers with their descriptions, you can call the GetDrivers() function to get a read-only dictionary with driver names as the key and their descriptions as their values.

public static ReadOnlyDictionary<string, string> GetDrivers(BasoliaMedia? basolia) { }
chevron-rightGetting deviceshashtag

To get a list of available sound devices from a sound driver, you can use the GetDevices() function to get all the available sound devices that the specified sound driver detected. The second argument is a string output variable that describes the active device.

public static ReadOnlyDictionary<string, string> GetDevices(BasoliaMedia? basolia, string driver, ref string activeDevice) { }
chevron-rightSetting active driverhashtag

To set the active driver for the application's lifetime, you can use the SetActiveDriver() function.

public static void SetActiveDriver(BasoliaMedia? basolia, string driver) { }
chevron-rightSetting active devicehashtag

To set the active device for a specified driver, you can use the SetActiveDevice() function.

public static void SetActiveDevice(BasoliaMedia? basolia, string driver, string device) { }
chevron-rightGetting current driver and devicehashtag

If you want to know your current device and driver that are being used by MPG123 to play music from, you'll need to use one of the following functions:

  • GetCurrent(): Gets the current driver and device that MPG123 reports

  • GetCurrentCached(): Gets the cached current driver and device that Basolia reports

chevron-rightResetting current driver and devicehashtag

If you want to reset the current driver and device to their default values, you can use this function. This resets to your primary output device determined by your operating system.

Last updated