Function createWavHeader

  • Creates a WAV header for a given data size, sample rate, and number of channels. Supports only PCM audio.

    Parameters

    • dataSize: number

      Size of the data in bytes

    • sampleRate: number

      Sample rate of the audio in Hz

    • channels: Channels

      Number of channels in the audio

    • bitDepth: BitDepth

      Bit depth of the audio

    Returns Buffer

    Buffer containing WAV header