Menu

Class WavAudio

Wav audio object. Used to create a WAV file from a PCM audio stream or a Flipnote object.

Currently only supports PCM s16_le audio encoding.

Hierarchy

Index

Constructors

constructor

  • new WavAudio(sampleRate: number, channels?: number, bitsPerSample?: number): WavAudio
  • Create a new WAV audio object

    Parameters

    • sampleRate: number

      audio samplerate

    • Default value channels: number = 1

      number of audio channels

    • Default value bitsPerSample: number = 16

      number of bits per sample

    Returns WavAudio

Properties

bitsPerSample

bitsPerSample: number

Number of bits per sample

channels

channels: number

Number of audio channels

dataUrl

dataUrl: string = null

mimeType

mimeType: "audio/wav"

sampleRate

sampleRate: number

Audio samplerate

Methods

getArrayBuffer

  • getArrayBuffer(): ArrayBufferLike

getBlob

  • getBlob(): Blob

getBuffer

  • getBuffer(): Buffer

getUrl

  • getUrl(): string

revokeUrl

  • revokeUrl(): void

writeSamples

  • writeSamples(pcmData: Int16Array): void
  • Add PCM audio frames to the WAV

    Parameters

    • pcmData: Int16Array

      signed int16 PCM audio samples

    Returns void

Static fromFlipnote

Static fromFlipnoteTrack