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. |