Skip to main content

setOutputDevice

since 1.5.0

Description​

Changes the output device which should be used for playing the audio (player must be enabled). Use enumerateOutputDevices to load the list of available devices.

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

setOutputDevice(device: ISynthOutputDevice | null): Promise<void>
ParameterSummary
deviceAll

The output device to use, or null to switch to the default device.

Examples​

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

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