Changing the default audio device on Windows is a tricky task, especially for Bluetooth audio devices. The APIs involved are undocumented and vary across Windows versions. The same problem applies to reconnecting to an already paired Bluetooth audio device.
The audio features described here are built on top of the Bluetooth Classic audio profiles — HFP, HSP, A2DP, and AVRCP. For a general explanation of what each of those profiles does, see the Bluetooth Classic profiles overview.
The Bluetooth Framework solves both. It provides a consistent way to enumerate audio devices, switch the system default, reconnect to a paired device without using the Windows Add Device dialog, act as an A2DP audio receiver, monitor audio levels, and control volume. Four classes cover the full workflow:
wclAudioSwitcher— enumerate available audio devices, select the default one, reconnect to and disconnect from Bluetooth audio devices.wclBluetoothAudioReceiver— turn a PC into a Bluetooth audio receiver.wclAudioMeter— measure the current audio level and receive change events.wclAudioVolume— read and change audio volume and mute state on a selected endpoint.
A fifth class, wclBluetoothAudioWatcher, is used together with the receiver to discover source devices. It is
introduced on the audio receiver page.
Topics
Audio switcher
The wclAudioSwitcher class enumerates available audio devices and selects the default one for playback and recording.
The full guide describes the properties of an audio device, how to change the system default for a specific role, how to reconnect
to an already paired Bluetooth audio device without the Windows Add Device dialog, and how to disconnect a single service of a
two-in-one headset.
Read the audio switcher guide →
Audio receiver
The audio receiver feature turns a PC into a Bluetooth playback device. The full guide covers pairing with a source device,
installing the A2DP service, using wclBluetoothAudioReceiver together with wclBluetoothAudioWatcher,
and the current limitations of the feature.
Read the audio receiver guide →
Volume control
Two classes handle volume: wclAudioMeter monitors the current audio level on an endpoint, and wclAudioVolume
reads and changes the stream volume and mute state. The full guide shows how to open an endpoint, read the peak level, and adjust
the master volume.
Frequently asked questions
- What can the Bluetooth Framework do with Bluetooth audio devices?
- The Bluetooth Framework's Bluetooth audio support is covered by three topic guides: the audio switcher guide (switching the system default audio device and reconnecting to already paired headphones without re-pairing), the audio receiver guide (acting as an A2DP audio receiver), and the volume control guide (reading or setting audio volume, mute state, and audio level metering).
- Which classes are involved in Bluetooth audio?
wclAudioSwitcherenumerates devices and manages the default and connection state;wclBluetoothAudioReceiverturns a PC into an A2DP receiver;wclAudioMetermeasures the audio level;wclAudioVolumereads and sets volume and mute. ThewclBluetoothAudioWatcherclass is used with the receiver to discover source devices.