But what if we want to apply some audio effects to our voice?
for this we are gonna put `something` in the between of those 2 streams. this something is gonna be an npm library called sox-audio
let’s install it with
npm install -s sox-audio
then let’s create a file:
and let’s add this code in it:
find the full code here
and try to talk: you should hear your voice like you are inside of a garage. I suggest you to use an headset during your tests, if you don’t you will add an echo in your voice and you will probably not be able to appreciate reverb effect.
Tell me more about audio effects
In general, sox-audio is just a wrapper on top of sox, so you can search online how to apply effects, but when you call
addEffect you are colling the cli command under the hood, so you can take any example of sox usage and apply the same params. here is a good article to start: https://h3manth.com/2009/01/08/sox-sound-exchange-2
check out the lesson 4 part 2 file here: https://github.com/jurgob/nodejs_audio_examples/blob/main/lesson_04__p2_multiple_audio_effects.js
you can specify a number from 0 to 3, corrisponding to a different effect:
node lesson_04__p2_multiple_audio_effects.js 3