wav-file-encoder
v1.0.4
Published
A simple encoder for WAV audio files
Downloads
3,710
Maintainers
Readme
wav-file-encoder
A simple encoder for WAV audio files.
NPM package: wav-file-encoder Online demo: www.source-code.biz/snippets/typescript/wavFileEncoder Example of how to use it: github.com/chdh/wav-file-encoder/tree/master/example
API
encodeWavFileFromAudioBuffer (audioBuffer: AudioBuffer, wavFileType: WavFileType) : ArrayBuffer
audioBuffer
: An AudioBuffer that contains the audio data.wavFileType
:WavFileType.int16
(0) for 16 bit signed integer,WavFileType.float32
(1) for 32 bit float.- Return value: An ArrayBuffer that contains the raw data bytes of the generated WAV file.
encodeWavFileFromArrays (channelData: ArrayLike<number>[], sampleRate: number, wavFileType: WavFileType) : ArrayBuffer
channelData
: Arrays containing the audio samples (PCM data). One array per channel.sampleRate
: Sample rate (samples per second).wavFileType
:WavFileType.int16
(0) for 16 bit signed integer,WavFileType.float32
(1) for 32 bit float.- Return value: An ArrayBuffer that contains the raw data bytes of the generated WAV file.