Description
See #634 (comment)
alphaTab should expose an API to allow changing the output device.
- Web
- Requesting permission:
await navigator.mediaDevices.getUserMedia({ audio: true });
- Listing devices:
(await navigator.mediaDevices.enumerateDevices()).filter(device => device.kind === 'audiooutput')
- DeviceID:
string
- Setting initial output:
new AudioContext({sinkID: device.deviceId})
- Changing output dynamically:
await audioContext.setSinkId(device.deviceId)
- Requesting permission:
- .net
- Requesting permission: not needed
- Listing devices:
NAudio.Wave.DirectSoundOut.Devices
- DeviceID:
System.Guid
- Setting initial output:
new NAudio.Wave.DirectSoundOut(deviceId, latency)
- Changing output dynamically: Not available, would require recreation
DirectSoundOut
- Android
- Requesting permission:
- Listing devices:
((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).getDevices(AudioManager.GET_DEVICES_OUTPUTS)
- DeviceID:
AudioDeviceInfo
- Setting initial output:
audioTrack.setPreferredDevice()
- Changing output dynamically:
audioTrack.setPreferredDevice()
alphaTab design:
- alphaTab should provide its own abstraction for the output devices to provide a unified experience across platforms.
- Due to the dynamic nature of first enumerating devices and then selecting one, the output device cannot be part of the
Settings
- Low Level API:
- The
ISynthOutput
initializes with the default device - A new
interface ISynthOutputDevice { ... }
will represent the platform specific devices. - A new
interface ISynthOutput { enumerateDevices(): Promise<ISynthOutputDevice>
method enumerate and list the devices (it also will request permissions if needed). - A new
interface ISynthOutput { setOutputDevice(device: ISynthOutputDevice|null): Promise<void>
method will change the output device. Null restores the default output device. - A new
interface ISynthOutput { getOutputDevice(): Promise<ISynthOutputDevice|null>
method try to determine the current output device. - Multiple
ISynthOutputDevice
instances for the same output device might be created across API calls.
- The
- High level API:
- Re-Expose
enumerateDevices
onAlphaTabApiBase
- Re-Expose
setOutputDevice
onAlphaTabApiBase
- Re-Expose
getOutputDevice
onAlphaTabApiBase
- Re-Expose
Metadata
Metadata
Assignees
Type
Projects
Status
Done