简体   繁体   中英

filter audio using Web Audio Api

Is there a way to filter music so as to get a karaoke effect on an mp3 using Web Audio API? Thus i can administer a lowpass or highpass to filter out the voice and leave the drums or melody If not eliminating it

As @brybott said you can use: https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode for filtering the audio. I made a lib for Web Audio API which you could use to make this easier.

CrotchetJS

And a code example could be something like:

<script src="Crotchet.js"></script>
<script>
   //CREATE A FILTER WITH ATTRIBUTES TYPE, FREQUENCY, GAIN and Q
   var filter = CROTCHET.createFilter("HIGHPASS", 6000, 20, 1000);
   CROTCHET.loadSounds(["file1.mp3"], ["sound"], filter);
   CROTCHET.play("sound");
</script>

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM