-
Notifications
You must be signed in to change notification settings - Fork 221
16 I2S
Geo edited this page Jan 30, 2026
·
11 revisions
This mode enables audio input/output communication over the I2S bus using BCLK, LRCK (WS), and DATA lines. It supports tone generation, PCM playback, microphone signal recording and analysis.
Arguments in < > are required, while arguments in [ ] are optional.
| Command | Description |
|---|---|
config |
Interactively configure BCLK, LRCK, DATA pins, sample rate, and bit depth |
play <freq> [dur] |
Plays a tone at the given frequency and optional duration (press Enter to stop early) |
record |
Records from the I2S microphone and displays signal visualization |
test mic |
Checks microphone signal strength and presence |
test speaker |
Plays test tones and audio patterns through the speaker |
reset |
Reverts I2S to output mode |
-
playgenerates square waves through I2S and supports both finite and interruptible playback. -
recordcompresses and visualizes input signal strength in real-time. -
test speakerplays:- A melody sequence
- Frequency sweep
- Binary test patterns
- PCM playback
-
test micreads microphone input, computes average signal energy, and confirms detection. -
resetensures output mode is restored after testing input.
mode i2s
config # Set I2S pins and parameters
play 440 1000 # Play tone for 1 second
play 880 # Play tone until Enter is pressed
record # Start signal visualization from mic
test mic # Check mic input
test speaker # Play test tones
reset # Reset to output mode


⚠️ Voltage Warning: Devices should only operate at 3.3V or 5V.
Do not connect peripherals using other voltage levels — doing so may damage your ESP32.