Ring modulator implemented in 22 lines of C.
Here's a ring modulator implemented in just 22 lines of C.
gcc ring.c -o ./ring
./ring <inputfile> <modulation freq>
./ring input.raw 1000
To keep the code simple, you will need to convert your input file to a 48kHz/32-bit raw PCM. This is easy to do with SoX like this:
sox input.mp3 -c 1 -r 48000 -b 32 -e float -t raw input.raw
This will output a 48kHz/32-bit raw PCM file called out.raw
.
play -c 1 -r 48000 -b 32 -e float -t raw out.raw