Skip to main content

alphaTab.synth.IAudioExporterWorker

This is the internal worker interface implemented by IAudioExporters and consists of the internal APIs needed to spawn new exporters. Its mainly used to simplify the public API visible when using exporters.

 interface IAudioExporterWorker extends IAudioExporter

Methods​

destroy​

(no description) (Inherited from IAudioExporter )

destroy(): void

initialize​

Initializes the worker.

initialize(options: AudioExportOptions, midi: MidiFile, syncPoints: BackingTrackSyncPoint[], transpositionPitches: Map<number, number>): Promise<void>
ParameterSummary
optionsAll

The options to use

midiAll

The midi file to load

syncPointsAll

The sync points of the song (if any)

transpositionPitchesAll

The initial transposition pitches for the midi file.

render​

Renders the next chunk of audio and provides it as result. (Inherited from IAudioExporter )

render(milliseconds: number): Promise<AudioExportChunk | undefined>
ParameterSummary
millisecondsAll

The rough number of milliseconds that should be synthesized and exported as chunk.

Returns​

The requested chunk holding the samples and time information. If the song completed playback undefined is returned indicating the end. The provided audio might not be exactly the requested number of milliseconds as the synthesizer internally uses a fixed block size of 64 samples for synthesizing audio. Depending on the sample rate slightly longer audio is contained in the result.

When the song ends, the chunk might contain less than the requested duration.