Record audio in Wave apps #1520
mturoci
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This snippet shows how to access the user's microphone, record the audio and upload it to the Wave server for further processing. It has been tested against modern Chrome, Firefox, and Safari.
Demo
Screen.Recording.2022-06-24.at.3.52.25.PM.mov
Code for Wave app
The demo app consists of the simplest UI possible - single button that triggers browser Javascript. After the recording is stopped, the audio file is converted to
wav
format to have it unified across all browsers, uploaded to Wave server and downloaded to wave app for local consumption (e.g. feeding ML model).Javascript (JS)
Since the microphone is present in the browser, we have no other chance than use custom JS within Wave app.
The interesting part is uploading the data to the Wave server
and sending Wave events.
The rest is out of the scope of Wave itself as it's deep Javascript, but feel free to copy-paste it. If it doesn't work as advertised, let us know :)
cc @vopani @lo5 @mtanco
Beta Was this translation helpful? Give feedback.
All reactions