Starting from version 7.17.0 Bluetooth Framework allows to switch system default audio devices and to re-connect to already paired Bluetooth Audio devices without re-installing services and re-pairing with the device. Starting from version 7.17.4 the library also allows to monitor and control audio volume for different audio devices.

AUDIO SWICTHER

System Default Audio Devices

AudioSwitcher Demo In Windows 10, there are a number of options which you can use to change sounds for different system events, configure output and input devices. Modern computers can use classic speakers, Bluetooth headphones and many other audio devices which you can connect simultaneously. The default audio output device is a device which Windows 10 is using to play the audio. Other device can be set to mute or to play the same audio stream.

Bluetooth Framework provides methods that allow to control audio devices in your system. The wclAudioSwitcher class provides features that aloows to enumerate available audio devices and to select default audio device for Multimedia, Communication, Games. You can separately select Input and Output audio devices for each Role.

To test this feature you can use AudioSwitcher demo application. Once it is started click the Open button. The application (by default) shows all active audio devices (see the picture above).

The Flow column shows how the device is used in the system:
- Render is an output audio device;
- Capture is an input audio device.

The Roles column shows a device's system role:
- Console - a device is used as default in games;
- Mutimedia - a device is used as default in multimedia;
- Communications - a device is used as default in communications.

If a device is a Bluetooth Audio device the MAC column will contain a device's MAC address and the Service column - a Bluetooth service used by a device. You can also enumerate Disabled, Unplugged and Not present devices.

To change a system default device select a device in the devices list, select its default Role in the Role dropdown box and click the Set default button.

Connect to Already Paired Bluetooth Audio Device

You can also re-connect to already paired Bluetooth Audio device. You do not need to unpair with device, re-install its services, etc. All you need to do is just: check Unplugged check box and click Enum button in the AudioSwitcher demo application (assume you already clicked the Open button). After that you will see the list of unplugged audio devices. Select the device you need to connect to (by its MAC or name) and click the Connect button. The system connects to the selected device (if one is available) and sets it as default. You can change the default audio device without disconnecting it.

Disconnect From Bluetooth Audio Device

To completely disconnect a connected Bluetooth Audio device you can use this simple method. However, some Bluetooth Audio devices may provide few Audio services: HandsFree and A2DP, HandsFree and HeadSet, etc. In this case you may need to disconnect just one service you do not want to use. To do that simple select an Audio Device from the devices list based on a Bluetooth service you want to disconnect from and click the Disconnect button. The required service will be disconnect but other one will keep connected and can be used.

VOLUME CONTROL

AudioVolume Demo The wclAudioMeter class allows your application to monitor audio level on a specified audio endpoint devices. You can show the volume to your application end-user. The wclAudioVolume class allows to control input and output stream volume on a specified audio endpoint devices. For more details refer to AudioVolume demo application.