Get audio from an html5 video

后端 未结 2 553
独厮守ぢ
独厮守ぢ 2021-01-31 06:07

Is it possible to get the audio from an mp4 or webm video element in HTML5?

I\'m trying to use https://github.com/corbanbrook/dsp.js to calculate FFTs for audio, however

2条回答
  •  广开言路
    2021-01-31 06:47

    Not sure if this answers your question but you can run the audio of the video through the Web Audio API node graph. The code below can be demonstrated by changing the gain and filter parameters. I only tested this on Chrome.

    
    
    
    
    
    
    
    
    
    

    The above code is a modified version of this : http://updates.html5rocks.com/2012/02/HTML5-audio-and-the-Web-Audio-API-are-BFFs

    I simply replaced the audio element with the video element.

提交回复
热议问题