generating audio waveform from youtube video
Asked Answered
K

1

7

does anyone know if is it possible to render an audio waveform from a video playing in a youtube player using Javascript? Thank you!

Kazim answered 28/11, 2012 at 11:30 Comment(2)
Are you asking for a .wav sound file or are you trying to generate a visual render of the waveform?Hypethral
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?...Kazim
C
2

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?

Corrective answered 24/6, 2016 at 9:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.