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
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 673782



Sign in to add a comment

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

Reported by michal.p...@gmail.com, 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:
https://dl.dropboxusercontent.com/u/841468/testcase/opus/index.html

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.
 
Cc: rtoy@chromium.org
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 rtoy@chromium.org, Sep 2 2014

Cc: dalecur...@chromium.org
This is a feature request. It seems that chrome currently doesn't compile ffmpeg with opus support.

+dalecurtis

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.

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 rtoy@chromium.org, 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.
Cc: cwilso@chromium.org
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.
Labels: -Cr-Internals-Media Cr-Blink-WebAudio

Comment 7 by amin...@google.com, Sep 8 2014

Labels: -M-37 MovedFrom-37 M-38
Moving all non essential bugs to the next Milestone.
Labels: -M-38 MovedFrom-38
This issue has already been moved once and is lower than Priority 1,therefore removing mstone.
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 rtoy@chromium.org, 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.)
#10's parenthetical comment refers to https://code.google.com/p/chromium/issues/detail?id=419446
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: https://code.google.com/p/chromium/issues/detail?id=482934)

Comment 13 by rtoy@chromium.org, May 5 2015

Mergedinto: 482934
Status: Duplicate
Merging into  issue 482934 .  We'll track the Opus decoder issue there.
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.
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 rtoy@chromium.org, 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.
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
MediaSource doesn't support ogg at all.
This page shows that opus is supported in an audio element: https://hpr.dogphilosophy.net/test/

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?

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

Comment 21 Deleted

I would have assumed that fixing https://code.google.com/p/chromium/issues/detail?id=482934 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?
Cc: -rtoy@chromium.org
Owner: rtoy@chromium.org
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.
Blockedon: 673782
Summary: WebAudio.decodeAudioData() does not support streams without a duration. (was: Cannot use Opus files with Web Audio API)

Comment 25 by rtoy@chromium.org, 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