convertbuffertowav
v0.0.14
Published
It is a helper converting audio buffer in to wav format
Downloads
1
Maintainers
Readme
convertBufferToWav
It is a helper converting audio buffer in to wav format
Install
$ npm install --save @bigear/convertBufferToWav
Usage
import convertBufferToWav from "@bigear/convertBufferToWav";
const {buffer} = this.bufferSourceNode
// console.log(buffer.getChannelData(1))
// AudioBufferSourceNode ...
// buffer : AudioBuffer ...
// channelCount: 2
// channelCountMode: "max"
// channelInterpretation: "speakers"
// context: AudioContext ...
// currentTime: 10.518639455782314, sampleRate: 44100, ...
// detune: AudioParam ...
// loop: false
const dataview = convertBufferToWav(buffer.getChannelData(0))
const audioBlob = new Blob([dataview], {type: 'audio/wav'})