How to adjust pitch of a <video> or <audio> element

151 views
Skip to first unread message

Yuan Yuan

unread,
Jul 25, 2018, 7:29:37 PM7/25/18
to Chromium HTML5
Hi,

I'm looking for ways to use Web Audio javascript API to adjust pitch of the music from a <video> or <audio> element.

I understand that if I use XMLHttpRequest to load a mp3 file, and then use decodeAudioData to get the buffer of the audio data, then I can use the SoundTouch library to adjust the pitch.

But I'm wondering whether I can directly do this from a <video> or <audio> element. 

I can create a media element source using createMediaElementSource, but I'm not sure how to get the buffer from this source to pass to the soundtouch library, or whether there are ways to adjust pitch without the need of getting the buffer.

Any help would be appreciated.

Thank you very much.

Yuan
Reply all
Reply to author
Forward
0 new messages