See #634 (comment)
alphaTab should expose an API to allow changing the output device.
- Web
- .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
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.
- High level API:
- Re-Expose
enumerateDevices on AlphaTabApiBase
- Re-Expose
setOutputDevice on AlphaTabApiBase
- Re-Expose
getOutputDevice on AlphaTabApiBase
See #634 (comment)
alphaTab should expose an API to allow changing the output device.
await navigator.mediaDevices.getUserMedia({ audio: true });(await navigator.mediaDevices.enumerateDevices()).filter(device => device.kind === 'audiooutput')stringnew AudioContext({sinkID: device.deviceId})await audioContext.setSinkId(device.deviceId)NAudio.Wave.DirectSoundOut.DevicesSystem.Guidnew NAudio.Wave.DirectSoundOut(deviceId, latency)DirectSoundOut((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).getDevices(AudioManager.GET_DEVICES_OUTPUTS)AudioDeviceInfoaudioTrack.setPreferredDevice()audioTrack.setPreferredDevice()alphaTab design:
SettingsISynthOutputinitializes with the default deviceinterface ISynthOutputDevice { ... }will represent the platform specific devices.interface ISynthOutput { enumerateDevices(): Promise<ISynthOutputDevice>method enumerate and list the devices (it also will request permissions if needed).interface ISynthOutput { setOutputDevice(device: ISynthOutputDevice|null): Promise<void>method will change the output device. Null restores the default output device.interface ISynthOutput { getOutputDevice(): Promise<ISynthOutputDevice|null>method try to determine the current output device.ISynthOutputDeviceinstances for the same output device might be created across API calls.enumerateDevicesonAlphaTabApiBasesetOutputDeviceonAlphaTabApiBasegetOutputDeviceonAlphaTabApiBase