The following examples illustrate WebRTC integration with the Web Audio API. They are borrowed and modified from Robert O'Callahan's MediaStream Processing API proposal.
If your goal is to have the best balance of small filesize and high quality, based on extensive production testing, your best bet is to default to webm and fallback to mp3. webm has nearly full browser coverage with a great combination of compression and quality. You'll need the mp3 fallback for Internet Explorer.
Opus is a totally open, royalty-free, highly versatile audio codec. Opus is unmatched for interactive speech and music transmission over the Internet, but is also intended for storage and streaming applications.
Opus replaces both Vorbis and Speex for new applications, and several blind listening tests have ranked it higher-quality than any other standard audio format at any given bitrate until transparency is reached, including MP3, AAC, and HE-AAC
Web App Audio
Howler.js
Blogs, etc
React / Redux Wrappers
Audio Containers, Codecs, etc
Audio Conversion
afconvert --file caff --data opus SomeTrack.wav
ffmpeg -i SomeTrack.wav -acodec libopus SomeTrack.webm
ffmpeg -i MyMusicTrack.wav MyMusicTrack.mp3