question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecordRTC Audio into Ogg Chrome

See original GitHub issue

Hi !

First thanks a lot for all the work done.

When I use RecordRTC demo in Chrome (v 43.0.2357.81 - 64bits) with Audio into OGG selected, the downloaded file is in WAV format.

Is that normal ? Is it possible to record audio in OGG with Chrome ?

I tried to set the options like this :

var options = {
    mimeType : 'audio/ogg',
    bitsPerSecond: 128000
};

But this is not working…

Regards

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
muaz-khancommented, Jun 18, 2016

Regarding CODECS:

  • Chrome supports VP9+VP8 along with opus vorbis audio (48kHz). PS: H.264 coming soon.
  • Firefox supports VP8 along with opus vorbis audio (44.1 kHz).

Regarding CONTAINER_FORMATS,

  • Chrome supports audio/webm, video/webm, video/webm;codecs=vp8 and video/webm;codecs=vp9
  • Firefox supports audio/webm, audio/ogg, video/webm, video/mp4 and video/webm;codecs=vp8

Regarding BITRATES:

  • Chrome supports opus_MIN 6kbps and opus_MAX 128kbps
  • Chrome supports VPX_MIN 100kbps and no max limit
  • Firefox supports VPX_default 2.5Mbps however audio default is adaptive dependant on the sample rate and number of audio channels

So you’ll always get audio/webm in Chrome rather than audio/ogg. You can change the file-extension (mp3/ogg) or file-type (audio/mp3 or audio/ogg) however Audio_RAW_DATA headers will be using audio/webm


Nowadays both Chrome+Firefox are accepting audioBitsPerSecond, videoBitsPerSecond as well as bitsPerSecond optional values (as 2nd-parameter over MediaRecorder API).

0reactions
hexadecycommented, Jan 2, 2017

Tested on

Windows 10 + Chrome 55 and Firefox 50

Media Stream options

type: “audio”

As a workaround change that part in RecordRTC.js

Firefox will record in audio/ogg Chrome will record in audio/webm

function GetRecorderType(mediaStream, config) {    
//...
    if (isMediaRecorderCompatible() && recorder !== CanvasRecorder && recorder !== GifRecorder && typeof MediaRecorder !== 'undefined' && 'requestData' in MediaRecorder.prototype) {
        if (mediaStream.getVideoTracks().length || (mediaStream.getAudioTracks().length && MediaRecorder.isTypeSupported('audio/webm'))) {
        recorder = MediaStreamRecorder;
        }
    }
//...

Pull request

How many previous version we want to support in this lib? Chrome 46, 47-48, 49… ? I think it’s better to check for MediaRecorder type support than specific version of Chrome like version 49 in isMediaRecorderCompatible(). ref: https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported

Read more comments on GitHub >

github_iconTop Results From Across the Web

Record as Ogg using MediaRecorder in Chrome
However, here are some libraries that help you record to ... be submitted to DialogFlow, since it requires Opus audio to have a...
Read more >
Problems with RecordRTC ogg files to Audacity - Moodle.org
I downloaded my user's online submission audio files from Chrome and FF: the file types are ostensibly .ogg but actually, they're WebM. Thanks ......
Read more >
Audio+Video+Screen Recording using RecordRTC
The audio is distorted exactly after 30 seconds in Mac chrome browser alone. I am using the below parameters to start the recording....
Read more >
RecordRTC: Home
RecordRTC is a server-less (entire client-side) JavaScript library can be used to record WebRTC audio/video media streams. It supports cross-browser ...
Read more >
Record to an Audio File using HTML5 and JS - nick's blog
Example. Here is the "simplest" way to record, play and download audio in Chrome (this also works in Firefox but ogg format is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found