spessasynth_core documentation
    Preparing search index...

    Function audioToWav

    • Converts PCM audio data into a fully valid wave file.

      The metadata uses the INFO chunk to write the information. It is encoded with utf-8.

      Parameters

      • audioData: Float32Array<ArrayBufferLike>[]

        The PCM audio data. For stereo, pass [leftData, rightData].

      • sampleRate: number

        The sample rate, in Hertz.

      • options: Partial<WaveWriteOptions> = DEFAULT_WAV_WRITE_OPTIONS

        Additional options for writing the file.

      Returns ArrayBuffer

      The binary file.

      Refer to `examples/midi_to_wav_node.ts` for an example of rendering audio data to a wav file.