Is it possible to change the tempo of audio (in the form of loaded MP3 files) without changing the pitch using the Web Audio API?
I'm aware of the playbackRate property on the AudioBufferSourceNode, but that also changes pitch. I'm also aware of the playbackRate property for <audio>
and <video>
elements, but I need to use the Web Audio API.
I'm very new to the Web Audio API. Is there anything I can do?
There is a way to do this - its called granular synthesis (link points to a pd theory link, but the theory is universal). The idea of granular synthesis is that a sound is sampled at the original speed, but it is played at a different speed from each sample point, however with the advantage that the pitch is not altered.
These Github Web Audio Granular Synthesiser links may help you (the first one is better): 1. Web-Audio-Granular-synthesis 2. Another link on Github2
Failing any success with WebAudio, there is the alternative; bring the mp3 into Audacity and change the tempo that way, and then use the new file! ;)
Believe me, I understand your pain, I spent weeks in uni trying to do exactly the same thing with pd-extended. Came near to tearing my hair out. My professor introduced me to the concept of granular synthesis - saved the day!
Good luck!
That's not natively (easily) supported by the current version of WebAudio, but it's possible using Tone.js: