Recording Remote Audio Streams / RecordRTC
"opus" is the default codec on chrome;
Chrome uses two modes for opus....
- "voip" (i.e. voice mode) which is used if mono audio stream is provided by the sender
- "audio" which is used if stereo audio stream is provided by the sender
There is no parameter in sdp allows us control voip/audio mode for outgoing/incoming audio streams. This job can be done by sender ( I don't know how, well, still experimenting ).
They're using code like this:
// Default to VoIP application for mono, and AUDIO for stereo.
int application = (channels == 1) ? OPUS_APPLICATION_VOIP : OPUS_APPLICATION_AUDIO;
state->encoder = opus_encoder_create(48000, channels, application, &error);
You can see that if channels equals 1; i.e. if mono audio; they're using "voip" mode. Otherwise "audio" mode.
In the session description; you can see this line:
a=rtpmap:111 opus/48000/2
It is mono section with 48000 Hz (i.e. highest) clock rate.
Bitrate is 48-64 kb/s .... i.e. FB mono music
For stereo; we need:
64-128 kb/s .... i.e. FB stereo music