Skip to main content

render

Description​

Renders the next chunk of audio and provides it as result.

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.