Skip to main content

alphaTab.synth.ISynthOutput

This is the base interface for output devices which can request and playback audio samples.

 interface ISynthOutput

Properties​

ready​

Fired when the output has been successfully opened and is ready to play samples.

readonly ready: IEventEmitter;

sampleRate​

Gets the sample rate required by the output.

readonly sampleRate: number;

sampleRequest​

Fired when the output needs more samples to be played.

readonly sampleRequest: IEventEmitter;

samplesPlayed​

Fired when a certain number of samples have been played.

readonly samplesPlayed: IEventEmitterOfT<number>;

Methods​

activate​

Activates the output component.

activate(): void

addSamples​

Called when samples have been synthesized and should be added to the playback buffer.

addSamples(samples: Float32Array): void
ParameterSummary
samplesAll

(no description)

destroy​

Requests the output to destroy itself.

destroy(): void

enumerateOutputDevices​

Loads and lists the available output devices. Will request permissions if needed.

enumerateOutputDevices(): Promise<ISynthOutputDevice[]>

getOutputDevice​

The currently configured output device if changed via setOutputDevice .

getOutputDevice(): Promise<ISynthOutputDevice | null>

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.

open(bufferTimeInMilliseconds: number): void
ParameterSummary
bufferTimeInMillisecondsAll

(no description)

pause​

Called when the output should stop the playback.

pause(): void

play​

Called when the output should start the playback.

play(): void

resetSamples​

Called when the samples in the output buffer should be reset. This is neeed for instance when seeking to another position.

resetSamples(): void

setOutputDevice​

Changes the output device which should be used for playing the audio.

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

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