Discussion:
Web Audio API - get Buffer from MediaElementAudioSourceNode
Benjamin Rumble
2014-05-06 00:36:38 UTC
Permalink
looks like you CAN now do this

http://isflashdeadyet.com/tests/web-audio-visualization/
Hey,
is there a way to use the AudioBuffer from a
MediaElementAudioSourceNode as a BufferSourceNode?
I'd really love to use methods like noteOn and noteGrain on a audio
source retrieved from a <audio/> element.
​var context = new webkitAudioContext();
var mediaSource = context.createMediaElementSource( myAudioElement );
var bufferSource = context.createBufferSource();
bufferSource.buffer = mediaSource.getBuffer() // <- fantasy code...
bufferSource.connect(context.destination);
bufferSource.noteOn(0);
​
Is that possible by any chance ?
Of course there's the possibilty of loading the AudioData directly
into the buffer via XHR request, but the request underlies some
restrictions (hello CORS) which the audio element does not.
Thank you in advance!
Cheers
Max
--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html5+unsubscribe-F7+***@public.gmane.org
To post to this group, send email to chromium-html5-F7+***@public.gmane.org
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
Jari Pennanen
2014-10-02 14:58:16 UTC
Permalink
No it's not possible even now.

That example you linked uses the "MediaElementAudioSourceNode" which
doesn't have start() and stop() methods etc. like in buffer. Reason we need
the buffer is that it's programmatically better.
Post by Benjamin Rumble
looks like you CAN now do this
http://isflashdeadyet.com/tests/web-audio-visualization/
Hey,
is there a way to use the AudioBuffer from a
MediaElementAudioSourceNode as a BufferSourceNode?
I'd really love to use methods like noteOn and noteGrain on a audio
source retrieved from a <audio/> element.
​var context = new webkitAudioContext();
var mediaSource = context.createMediaElementSource( myAudioElement );
var bufferSource = context.createBufferSource();
bufferSource.buffer = mediaSource.getBuffer() // <- fantasy code...
bufferSource.connect(context.destination);
bufferSource.noteOn(0);
​
Is that possible by any chance ?
Of course there's the possibilty of loading the AudioData directly
into the buffer via XHR request, but the request underlies some
restrictions (hello CORS) which the audio element does not.
Thank you in advance!
Cheers
Max
--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html5+unsubscribe-F7+***@public.gmane.org
To post to this group, send email to chromium-html5-F7+***@public.gmane.org
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
Yuan Yuan
2018-07-25 20:24:02 UTC
Permalink
Hi Max,

I know it has been a long time since 2012. :)
I'm facing the same problem and just wondering whether you have got any
solution or not.

Thanks,

Yuan
Hey,
is there a way to use the AudioBuffer from a
MediaElementAudioSourceNode as a BufferSourceNode?
I'd really love to use methods like noteOn and noteGrain on a audio
source retrieved from a <audio/> element.
​var context = new webkitAudioContext();
var mediaSource = context.createMediaElementSource( myAudioElement );
var bufferSource = context.createBufferSource();
bufferSource.buffer = mediaSource.getBuffer() // <- fantasy code...
bufferSource.connect(context.destination);
bufferSource.noteOn(0);
​
Is that possible by any chance ?
Of course there's the possibilty of loading the AudioData directly
into the buffer via XHR request, but the request underlies some
restrictions (hello CORS) which the audio element does not.
Thank you in advance!
Cheers
Max
--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html5+***@chromium.org.
To post to this group, send email to chromium-***@chromium.org.
Visit this group at https://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
Loading...