Record a short audio file using WebRTC

In the online social learning app, we want participants to be able to record short audio clips to share with others. Typically, the entry will be a spoken word or one sentence.

I watched WebRTC. I understand how to create and transmit an audio stream. However, we want the participant to be able to start recording manually and stop it at the end (or after 15 seconds if this happens earlier). Ideally, we want to compress the resulting file to save bandwidth and load it into the database.

Can anyone recommend any tutorials on how to do this?

+4
source share
1 answer

Perhaps RecordRTC will help you. https://webrtc-experiment.appspot.com/RecordRTC/

Try this demo:

https://github.com/muaz-khan/WebRTC-Experiment/tree/master/AudioVideoRecorder

In the demo; MediaRecorder API used to record audio streams. This is exactly what you want; however, current support is Firefox Nightly (only).

The Chrome team also began a discussion of possible scenarios; and exposure. Soon they will be implemented by the MediaRecorder API .

+1
source

All Articles