Skip to main content

alphaTab.synth.IBackingTrackSynthOutput

A synth output for playing backing tracks.

 interface IBackingTrackSynthOutput extends ISynthOutput

Properties​

backingTrackDuration​

The total duration of the backing track in milliseconds.

readonly backingTrackDuration: number;

masterVolume​

The volume at which the output should play (0-1)

masterVolume: number;

playbackRate​

The playback rate at which the output should playback.

playbackRate: number;

ready​

Fired when the output has been successfully opened and is ready to play samples. (Inherited from ISynthOutput )

readonly ready: IEventEmitter;

sampleRate​

Gets the sample rate required by the output. (Inherited from ISynthOutput )

readonly sampleRate: number;

sampleRequest​

Fired when the output needs more samples to be played. (Inherited from ISynthOutput )

readonly sampleRequest: IEventEmitter;

samplesPlayed​

Fired when a certain number of samples have been played. (Inherited from ISynthOutput )

readonly samplesPlayed: IEventEmitterOfT<number>;

timeUpdate​

An event fired when the playback time changes. The time is in absolute milliseconds.

readonly timeUpdate: IEventEmitterOfT<number>;

Methods​

activate​

Activates the output component. (Inherited from ISynthOutput )

activate(): void

addSamples​

Called when samples have been synthesized and should be added to the playback buffer. (Inherited from ISynthOutput )

addSamples(samples: Float32Array): void
ParameterSummary
samplesAll

(no description)

destroy​

Requests the output to destroy itself. (Inherited from ISynthOutput )

destroy(): void

enumerateOutputDevices​

Loads and lists the available output devices. Will request permissions if needed. (Inherited from ISynthOutput )

enumerateOutputDevices(): Promise<ISynthOutputDevice[]>

getOutputDevice​

The currently configured output device if changed via setOutputDevice . (Inherited from ISynthOutput )

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

loadBackingTrack​

Instructs the output to load the given backing track.

loadBackingTrack(backingTrack: BackingTrack): void
ParameterSummary
backingTrackAll

The backing track to load.

open​

Called when the output should be opened. (Inherited from ISynthOutput )

open(bufferTimeInMilliseconds: number): void
ParameterSummary
bufferTimeInMillisecondsAll

(no description)

pause​

Called when the output should stop the playback. (Inherited from ISynthOutput )

pause(): void

play​

Called when the output should start the playback. (Inherited from ISynthOutput )

play(): void

resetSamples​

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

resetSamples(): void

seekTo​

Instructs the output to seek to the given time position.

seekTo(time: number): void
ParameterSummary
timeAll

The absolute time in milliseconds.

setOutputDevice​

Changes the output device which should be used for playing the audio. (Inherited from ISynthOutput )

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

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