1.0.15 • Published 4 years ago
web-audio-wave-recorder v1.0.15
web-audio-wave-recorder
Record wav files using Web Audio APIs
Unfortunately, MediaRecorder does not support wav files (technically linear PCM encoding). This uses the older and less fluent AudioContext API, manually dealing with audio buffers and .wav
header construction.
API
start(options: RecordingOptions): Promise<RecordingState>
Takes optional recording options and starts recording.
stop(recordingState: RecordingState): Promise<Blob>
Takes required recording state and returns a blob of type audio/wav
.
Prior art
- Based heavily on meziantou: Javascript - Record audio
- References Capturing Voice Input in a Browser and Sending it to Amazon Lex
Author
© 2019 Tom Vincent git@tlvince.com (https://tlvince.com)
License
Released under the MIT license.