alphaTab.synth.ISynthOutput
This is the base interface for output devices which can request and playback audio samples.
interface ISynthOutputPropertiesโ
readyโ
Fired when the output has been successfully opened and is ready to play samples.
- JavaScript
- C#
- Kotlin
sampleRateโ
Gets the sample rate required by the output.
- JavaScript
- C#
- Kotlin
readonly sampleRate: number;double SampleRate { get; }val sampleRate: DoublesampleRequestโ
Fired when the output needs more samples to be played.
- JavaScript
- C#
- Kotlin
readonly sampleRequest: IEventEmitter;IEventEmitter SampleRequest { get; }val sampleRequest: IEventEmittersamplesPlayedโ
Fired when a certain number of samples have been played.
- JavaScript
- C#
- Kotlin
readonly samplesPlayed: IEventEmitterOfT<number>;IEventEmitterOfT<double> SamplesPlayed { get; }val samplesPlayed: IEventEmitterOfT<Double>Methodsโ
activateโ
Activates the output component.
- JavaScript
- C#
- Kotlin
activate(): voidvoid Activate()fun activate(): UnitaddSamplesโ
Called when samples have been synthesized and should be added to the playback buffer.
- JavaScript
- C#
- Kotlin
addSamples(samples: Float32Array): voidvoid AddSamples(Float32Array samples)fun addSamples(samples: Float32Array): Unit| Parameter | Summary |
|---|---|
samplesAll | (no description) |
destroyโ
Requests the output to destroy itself.
- JavaScript
- C#
- Kotlin
destroy(): voidvoid Destroy()fun destroy(): UnitenumerateOutputDevicesโ
Loads and lists the available output devices. Will request permissions if needed.
- JavaScript
- C#
- Kotlin
enumerateOutputDevices(): Promise<ISynthOutputDevice[]>System.Threading.Task<IList<ISynthOutputDevice>> EnumerateOutputDevices()suspend fun enumerateOutputDevices(): alphaTab.collections.List<ISynthOutputDevice>getOutputDeviceโ
The currently configured output device if changed via setOutputDevice .
- JavaScript
- C#
- Kotlin
getOutputDevice(): Promise<ISynthOutputDevice | null>System.Threading.Task<ISynthOutputDevice?> GetOutputDevice()suspend fun getOutputDevice(): ISynthOutputDevice?Returnsโ
The custom configured output device which was set via setOutputDevice or null
if the default outputDevice is used.
The output device might change dynamically if devices are connected/disconnected (e.g. bluetooth headset).
openโ
Called when the output should be opened.
- JavaScript
- C#
- Kotlin
open(bufferTimeInMilliseconds: number): voidvoid Open(double bufferTimeInMilliseconds)fun open(bufferTimeInMilliseconds: Double): Unit| Parameter | Summary |
|---|---|
bufferTimeInMillisecondsAll | (no description) |
pauseโ
Called when the output should stop the playback.
- JavaScript
- C#
- Kotlin
pause(): voidvoid Pause()fun pause(): Unitplayโ
Called when the output should start the playback.
- JavaScript
- C#
- Kotlin
play(): voidvoid Play()fun play(): UnitresetSamplesโ
Called when the samples in the output buffer should be reset. This is neeed for instance when seeking to another position.
- JavaScript
- C#
- Kotlin
resetSamples(): voidvoid ResetSamples()fun resetSamples(): UnitsetOutputDeviceโ
Changes the output device which should be used for playing the audio.
- JavaScript
- C#
- Kotlin
setOutputDevice(device: ISynthOutputDevice | null): Promise<void>System.Threading.Task<void> SetOutputDevice(ISynthOutputDevice? device)suspend fun setOutputDevice(device: ISynthOutputDevice?): Unit| Parameter | Summary |
|---|---|
deviceAll | The output device to use, or null to switch to the default device. |