Voice Changing USB Mic
This example pairs the I2S microphone breakout with USB audio, which was also added in CircuitPython version 10.3.0-alpha.3. It is a voice changing microphone. The Metro will present to the host computer as a USB microphone and will pass modified audio from the I2S mic to the computer. Audio modules from the CircuitPython core can be used to add effects and manipulate the audio before outputting it to the computer.
10.3.0-alpha.3 or newer. Download it from the Metro RP2350 downloads page. As of 7/2/26 it is the latest development release.
Connect the following pins between the Metro RP2350 and microphone breakout.
- 3V Metro -> 3V ICS43434 breakout
- GND Metro -> GND ICS43434 breakout
- D5 Metro -> BCLK bit clock on the ICS43434 breakout
- D6 Metro -> LRCL word select on the ICS43434 breakout
- D9 Metro -> DOUT data out on the ICS43434 breakout
Update boot.py
The USB audio portion of this example requires a little bit of setup inside of the boot.py file.
# SPDX-FileCopyrightText: 2026 Tim Cocks for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import usb_audio
usb_audio.enable(
sample_rate=16000, channel_count=1, bits_per_sample=16, microphone=True
)
Code
Click the Download Project Bundle button below to download the project's code.py and boot.py in a zip file.
Connect your board to your computer via a known good data+power USB cable. The board should show up in your File Explorer/Finder (depending on your operating system) as a flash drive named CIRCUITPY.
Extract the contents of the zip file. Copy the code.py file, as well as boot.py folder to your CIRCUITPY drive. You need to reset the device once after pasting the code files so that the USB configuration in boot.py will take effect. Use the reset button or unplug then re-connect it.
# SPDX-FileCopyrightText: 2026 Tim Cocks for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""USB Voice changing microphone. Gets audio from I2S mic, applies
filters and effects, then passes the modified audio out via USB to
the host computer.
Must enable usb_microphone in boot.py.
Wiring:
bclk -> board.D5
word select -> board.D6
data -> board.D9
"""
import audiodelays
import board
import audioi2sin
import usb_audio
import audiofreeverb
import audiofilters
usb_mic = usb_audio.usb_microphone
with audioi2sin.I2SIn(
board.D5, board.D6, board.D9, sample_rate=16000, bit_depth=16
) as i2s_mic:
pitch_shift = audiodelays.PitchShift(
semitones=5.0,
mix=0.5,
window=2048,
overlap=256,
buffer_size=1024,
channel_count=1,
sample_rate=16000,
)
pitch_shift.play(i2s_mic)
reverb = audiofreeverb.Freeverb(
roomsize=0.35,
damp=0.25,
buffer_size=1024,
channel_count=1,
sample_rate=16000,
mix=0.45,
)
reverb.play(pitch_shift)
# amp used for pre_gain only to boost volume
amp = audiofilters.Distortion(
pre_gain=23.6,
drive=0.00,
mode=audiofilters.DistortionMode.LOFI,
soft_clip=True,
mix=1.0,
buffer_size=1024,
sample_rate=16000,
bits_per_sample=16,
samples_signed=True,
channel_count=1,
)
amp.play(reverb)
usb_mic.play(amp)
try:
while True:
pass
except KeyboardInterrupt:
pass
Drive Structure
After copying the files, your CIRCUITPY drive should look like the listing below. It can contain other files as well, but must contain these at a minimum.
Use
Set the Metro as the input device for your system, or for a specific application you wish to use with the voice changing mic. Different operating systems and applications will vary on how to set it. Look for recording, microphone, or audio input related settings. Once the input is selected start talking into the mic and the manipulated audio stream will be fed into your system or app. Tinker with the effects in the code to change the way it makes your voice sound.
Set the Metro as the input device for your system, or for a specific application you wish to use with the voice changing mic. Different operating systems and applications will vary on how to set it. Look for recording, microphone, or audio input related settings. If you are presented with multiple choices for the Metro like front, rear, line etc, choose the "front" device.
The screenshots here show how to find and select the mic for Ubuntu system, Audacity, and Discord.
Once the input is selected start talking into the mic and the manipulated audio stream will be fed into your system or app. Tinker with the effects in the code to change the way it makes your voice sound.
Here is an example of the effects that can be produced by the voice changing microphone.
Page last edited July 06, 2026
Text editor powered by tinymce.