New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 25 users

Issue metadata

Status: Fixed
Merged: issue 482934
Closed: Mar 2017
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 673782

Sign in to add a comment

Issue 409402: WebAudio.decodeAudioData() does not support streams without a duration.

Reported by, Aug 30 2014

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2140.0 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Use decodeAudioData() with Opus file

What is the expected behavior?
Opus audio file should be decoded successfully. (Chrome supports Opus files - at least in HTML5 audio tag)

What went wrong?
Chrome cannot decode Opus audio files. (It calls the errorCallback in decodeAudioData)

Did this work before? No 

Is it a problem with Flash or HTML5? HTML5

Does this work in other browsers? Yes 

Chrome version: 39.0.2140.0  Channel: canary
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 15.0 r0

It works in Firefox.

Comment 1 by, Sep 1 2014

Labels: -Type-Bug -OS-Windows Type-Feature OS-All M-37
Status: Untriaged
Able to reproduce the issue on latest stable 37.0.1062.102 and canary 39.0.2141.0 on Win7 desktop.

Issue not seen in FF.

rtoy@, would you mid take a look at this issue. I have added type-feature label. Please feel free to remove, if its not.

Comment 2 by, Sep 2 2014

This is a feature request. It seems that chrome currently doesn't compile ffmpeg with opus support.


I defer to Dale on whether we should do this or not. It might also be an issue on Android, where we use Android's MediaCodec framework to decode audio files.

Comment 3 by, Sep 3 2014

Is this a feature request? I'm not familiar with Chrome media architecture, but since Chrome already supports Opus files in <audio> elements (thus it has to use some Opus decoder), shouldn't Opus files be automatically supported in Web Audio API as well?

Comment 4 by, Sep 3 2014

I don't know how audio tags work, but I agree that if audio tags can decode it, then so should webaudio.

Comment 5 by, Sep 3 2014

AudioFileReader would need to be upgraded to use the OPUS decoder directly instead of the FFmpeg one to implement this feature. It's not too hard, it just isn't implemented.

WebAudio does not use the decoder set used by <audio> / <video>, rather it interfaces directly with one of the decoders used (ffmpeg).

I defer to rtoy@ on where this lies in the WebAudio roadmap.

Comment 6 by, Sep 3 2014

Labels: -Cr-Internals-Media Cr-Blink-WebAudio

Comment 7 by, Sep 8 2014

Labels: -M-37 MovedFrom-37 M-38
Moving all non essential bugs to the next Milestone.

Comment 8 by, Sep 9 2014

Labels: -M-38 MovedFrom-38
This issue has already been moved once and is lower than Priority 1,therefore removing mstone.

Comment 9 by, Oct 26 2014

Decoding opus and post processing the linear audio samples is not possible with Web Audio API without this correct? If so also putting in a vote to add opus support. Would like to not have to ask customers to use Firefox for enhanced playback application.

Comment 10 by, Jan 23 2015

As a workaround, you can use MediaElementAudioSourceNode to decode the Opus file and send that to webaudio. (This currently does not work on Android.)

Comment 11 by, Apr 24 2015

#10's parenthetical comment refers to

Comment 12 by, May 5 2015

The workaround is not good if you want play the audio with precise timing (e.g. for audio streaming from the server). AudioBufferSourceNode allows to schedule playback very precisely, but it requires AudioBuffer that can be created using decodeAudioData().

Practically this bug makes the voice communication between Firefox (it's recording OGG using Opus) and Chrome very difficult. (OGG case:

Comment 13 by, May 5 2015

Mergedinto: 482934
Status: Duplicate
Merging into  issue 482934 .  We'll track the Opus decoder issue there.

Comment 14 by, Feb 3 2016

Now that MediaRecorderAPI is alive, it would be nice to be able to decode the recorded buffer into web audio for further processing. 

The MediaElementAudioSourceNode workaround does not support sample accurate playback, right? Otherwise would that be a memory efficient alternative to using AudioBuffers in web audio.

Comment 15 by, Jan 31 2017

It would be great if this got Chrome support. Am I correct in saying that the Chrome can't export recorded MediaRecorder audio right now? As in saving it to a blob, or is there another codec I could use?

Comment 16 by, Jan 31 2017

Status: Available (was: Duplicate)
Chrome can export the output of MediaRecorder.  The issue here is that WebAudio cannot read the exported webm file. 

Hmm. This is marked as a duplicate; it's not.  I'm re-opening this and removing the dup.

Comment 17 by, Feb 7 2017

It also doesn't appear to be possible to use opus in a MSE source buffer.

Would it be possible for support to be added there too?

MediaSource.isTypeSupported('audio/ogg; codecs="opus"'); // false

Comment 18 by, Feb 7 2017

MediaSource doesn't support ogg at all.

Comment 19 by, Feb 7 2017

This page shows that opus is supported in an audio element:

Is it not possible to provide the same file to MSE?

If I want to use opus with MSE will I have to transmux it to webm then?


Comment 20 by, Feb 7 2017

Correct, you'll have to remux them to webm at present.

Comment 21 Deleted

Comment 22 by, Feb 7 2017

I would have assumed that fixing would have made it possible to decode the recorded buffer from Chrome now.

But it seems that is still not the case can anyone elaborate more?

Comment 23 by, Feb 7 2017

Status: Started (was: Available)
This is specifically about decodeAudioFileData() being unable to decode streams without a duration since it doesn't know how long they are. It's a technical detail of the implementation that rtoy@ is working on fixing.

Comment 24 by, Feb 7 2017

Blockedon: 673782
Summary: WebAudio.decodeAudioData() does not support streams without a duration. (was: Cannot use Opus files with Web Audio API)

Comment 25 by, Mar 9 2017

Status: Fixed (was: Started)
 Issue 482934  and  issue 673782  are both closed.

I believe this issue (decodeAudioData unable to decode streams with unknown duration) is fixed.

Please reopen if the issue still exists or file a new bug (with component Blink>WebAudio).

Sign in to add a comment