does anyone know if is it possible to render an audio waveform from a video playing in a youtube player using Javascript? Thank you!
-
Are you asking for a .wav sound file or are you trying to generate a visual render of the waveform? – rdrkt Nov 28 '12 at 11:52
-
Sorry, actually I was not very clear. I'll try to correct my question: i'd like to use javascript to draw the audio waveform overview of the audio track of a YT video, while it's playing (or even better before it starts playing) in an embedded JavaScript YouTube Player controlled through Youtube Javascript Player API. Someone knows if it's possible?... – Gianluca Sibaldi Apr 19 '13 at 12:35
1 Answers
On the client side, it's not possible to isolate the audio from the video data. You would need to get the raw audio data to be able to then process it with the WebAudio API (e.g. display it).
There are some server-side solutions (extracting audio from video, sending it back etc.), but that's not legal, as it's written in the TOS of youtube: (https://developers.google.com/youtube/terms?hl=fr)
You are not allowed to:
separate, isolate, or modify the audio or video components of any YouTube >audiovisual content made available through the YouTube API;
promote separately the audio or video components of any YouTube audiovisual >content made available through the YouTube API;
See this questions for more details: Is there a Youtube API that gives only audio?