This Audio Hacker example shows how you can manipulate audio to radically change recorded samples. This project uses a technique called granular synthesis, to raise and lower the pitch of a sample. It’s easy to change the pitch of a sample by playing it slower or faster, but granular synthesis allows you to alter the pitch without changing duration of the sample. So if a recorded sample was 5 seconds long, we can play it back at a higher or lower pitch, but the played sample will still have a duration of 5 seconds.
The technique is rather complex, but it involves dividing the sample up into small fragments called “grains”. When playing back a sample, if we want the pitch higher, we play the grain at a higher speed, but we play it over and over again until it takes the same amount of time as the grain played at original speed. Likewise, to lower pitch, we play each grain at a slower speed, but move onto the next grain sooner so that the overall sample has the same duration.
This technique introduces some noise, but it works really well with voice recordings. To send your voice into the Audio Hacker, I recommend using Audacity. Enable the monitoring feature for the microphone so that anything picked up by the computer’s microphone to the computer’s audio output, which is connected to the Audio Hacker input.
For this project I used the DJ Shield because it has 5 buttons and 3 pots. Record a sample with a button on D5, and playback with a button on D6. A potentiometer connected to A0 changes the pitch after recording. Before recording, set the A0 pot to the midpoint. When playing back a sample, use A0 to alter the pitch.
But there’s more! A potentiometer connected to A1 changes the size of the grains. And a potentiometer on A2 allows you to “stretch” each grain and play it multiple times. Now using all of these controls, we can do some really fun stuff! Here’s a video showing what you can do:
The Arduino sketch source code is an example in the Audio Hacker library: File->Examples->Audio Hacker->VoiceChanger.
Is there a way to make this work in real time
And be portable with a mic and power supply say like mounted
In a helmet? If yes do you make them and sell them
If it were possible to do it in realtime, I certainly would have!
Wait. If it’s not possible to do this in real time, then why does the audio hacker page have “electret microphone” under “input type” as an option?
You can use a microphone as input. That has nothing to do with whether you can manipulate the audio in realtime with this project. You can record your voice on the Audio Hacker and then manipulate it, but you cannot manipulate it while you are speaking (realtime).
WHY DOES IT NOT WORK
Can this project be done using standalone avr mcu rather than using arduino?
If possible please give details.
Yes, if you build a standalone Arduino circuit and connect the Audio Hacker to it with all the shield pins connected to the corresponding ATmega328 pins.
Yes I want a voice changer that sounds like a hacker
PLEASE TELL ME WHY DOES IT NOT WORK
Is there an upgrade for this project? All the other Audio Hacker examples work except the voice changer. I’m running on a Duemilanove 328. The program just dies in the middle of sending the first serial report. Do I need a faster Arduino for this?
A Duemilanove should work just fine. It has the same chip as an Uno. Have you tried turning off debugging by commenting out
? There’s not much reason to have the debugging on and maybe it is interfering with the audio interrupt.
Make a video a whole project
Please my maximum 90 friends working on this project i shaire that but all say please make a whole video
please make a video and help me and my friends
what? I thought I explained the project very well already and provided source code.
can i change my voice into another person voice by this project
No,it only change the pitch of the recording.
that is awsome
Après avoir régler les boutons pour obtenir une voix bien précise et ne plus y toucher, peut-on l’utiliser un micro en temps réel?
For realtime voice changer, see this project: https://nootropicdesign.com/projectlab/2019/09/07/arduino-realtime-voice-changer/