Recording Sounds from AudioContext (Web Audio API)

Is there a way to record audio data sent to webkitAudioContext.destination ?

The data that the nodes send there is reproduced by the browser, so it must somehow store this data in a file (.wav).

+6
source share
2 answers

There is currently no own way to do this, but as Max said in the comment above, Recorderjs does this essentially (it does not bind to the destination, but is a ScriptProcessorNode to which you can connect other nodes, and its record is recorded. I built on Recorderjs to make a simple sound recording file - https://github.com/cwilso/AudioRecorder .

+5
source

Sine to opus file: https://developer.mozilla.org/de/docs/Web/API/AudioContext/createMediaStreamDestination

In the following simple example, we create MediaStreamAudioDestinationNode, OscillatorNode and MediaRecorder (so the example will only work in Firefox at this time.) MediaRecorder is configured to record information from MediaStreamDestinationNode.

Chrome also supports it: https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder

+2
source

All Articles