convertbuffertowav

It is a helper converting audio buffer in to wav format

Usage no npm install needed!

<script type="module">
  import convertbuffertowav from 'https://cdn.skypack.dev/convertbuffertowav';
</script>

README

convertBufferToWav

It is a helper converting audio buffer in to wav format

npm-img npm-url

nodei.co

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'})