Skip to main content

enumerateOutputDevices

since 1.5.0

Description​

Loads and lists the available output devices which can be used by the player. Will request permissions if needed.

The values provided, can be passed into setOutputDevice to change dynamically the output device on which the sound is played.

In the web version this functionality relies on experimental APIs and might not yet be available in all browsers. https://caniuse.com/mdn-api_audiocontext_sinkid

enumerateOutputDevices(): Promise<ISynthOutputDevice[]>

Returns​

the list of available devices or an empty list if there are no permissions, or the player is not enabled.

Examples​

const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
const devices = await api.enumerateOutputDevices();

buildDeviceSelector(devices, async selectedDevice => {
await api.setOutputDevice(selectedDevice);
});