Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtain an AudioBuffer from a MediaElementAudioSourceNode #1872

Closed
TobyMellor opened this issue May 10, 2019 · 7 comments
Closed

Obtain an AudioBuffer from a MediaElementAudioSourceNode #1872

TobyMellor opened this issue May 10, 2019 · 7 comments

Comments

@TobyMellor
Copy link

TobyMellor commented May 10, 2019

Describe the feature
The ability to obtain a buffer source from an audio element. Even when an audio element is fully loaded, it's not possible to schedule samples of audio using a MediaElementAudioSourceNode.

https://groups.google.com/a/chromium.org/forum/?fromgroups#!topic/chromium-html5/HkX1sP8ONKs

https://stackoverflow.com/questions/11292076/load-audiodata-into-audiobuffersourcenode-from-audio-element-via-createmediae

@TobyMellor
Copy link
Author

For context, I'm trying to precisely schedule audio that comes from EME https://developers.google.com/web/fundamentals/media/eme.

e.g. Using https://developer.spotify.com/documentation/web-playback-sdk/ or Apple's Player

@rtoy
Copy link
Member

rtoy commented May 10, 2019

I think the third answer on the stackoverflow question will do what you want: connect a ScriptProcessorNode or AudioWorkletNode to the output of the MediaElementAudioSourceNode and capture the audio data to do whatever you want with it, including making an AudioBuffer for use with an AudioBufferSourceNode.

Not sure how useful that will be since you don't have a whole lot of control over when you get the data so the captured data won't be sample accurate, even if the AudioBufferSourceNode will give you sample-accurate timing.

@TobyMellor
Copy link
Author

Thank you. Yes I'm not sure if this would work in my case.

Perhaps EME support for an AudioBuffer could be considered? Or some implementation of setMediaKeys? I can't find any examples at all of where WebAudio was used with EME :(

@rtoy
Copy link
Member

rtoy commented May 10, 2019

There is work on a new decoding API and that would presumably include support for EME. The shape of the API or even all the capabilities aren't known yet; we're still in the early stages. But I think it will be handled by the media API and not WebAudio. But certainly the needs of WebAudio should influence the decoding API.

@rtoy
Copy link
Member

rtoy commented May 23, 2019

This needs to be reviewed by the group.

@rtoy rtoy added this to Untriaged in V1 via automation May 23, 2019
@rtoy
Copy link
Member

rtoy commented May 30, 2019

Teleconf: Too late to do anything in v1. Punting to the next version.

@rtoy rtoy added this to the Web Audio v.next milestone May 30, 2019
@hoch hoch removed this from Untriaged in V1 May 30, 2019
@mdjp
Copy link
Member

mdjp commented Sep 17, 2019

This will not be considered for V2, as it is better placed in webcodecs.

https://github.com/WICG/web-codecs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants