Is there any way to change playback rate (or get the BiquadFilter's detune to work) when the source has been created from a media audio element?
I know it's possible to change audio elements' playback speed while preserving pitch, and I realise that this is relatively fancy in DSP terms, but I'm after the 'traditional' consequence of adjusting the sample rate: commensurate pitch change, like when speeding up or slowing down magnetic tape. The fact that timestretching without pitchshifting is possible makes me think that there's no obstacle (in principle) due to the timing-based nature of the effect; it might just be that nobody's been interested in this before - after all, the behaviour I'm trying to achieve is undesirable for lots of applications.
I know I can do this by reading in my audio files as audioBuffers, but there are various other reasons why this won't be suitable in my case.
Is this just a limitation of the HTML5 audio element, or can anyone suggest another way I might achieve this while using createMediaElementSource?
(Edit: I'm building an Electron app, so working in Chrome - though I'm testing in Firefox too while I try to figure this out.)
Many thanks!
If the MediaElement doesn't do what you want, there's nothing WebAudio can do about that.
However, you also said BiquadFilter's detune is not working. What does that mean? And how is that related to the spec? Please file an issue on the BiquadFilter not working with your browser.
Thanks rtoy - apologies for posting in the wrong place.
As for MediaElement vs WebAudio, perhaps I misunderstand the relationship between the two, and the nature of createMediaElementSource - I'll study the spec more closely.
createMediaElementSource basically lets you pipe an audio (or video) element into WebAudio so you can do fun effects. So WebAudio just sees this as an audio source which is controlled outside of WebAudio.
However, people have asked for more fine-grained control like sample-accurate start of media elements, so your question kind of fits in with enhancing either WebAudio or MediaElements to do what people would like.
Ah, so it's more a pipe for control and connections than a new object/buffer being created on the WA side - that clears things up for me, thanks!
No issue left here - closing.
Firefox supports that using mozPreservesPitch (set it to false). We're going to remove it because, although we've implemented it and talked about it on the relevant mailing lists, nobody really cared for it.
@padenot I'm also after this use case, it's essential - consumers will care for it