16 I2S - geo-tp/ESP32-Bus-Pirate GitHub Wiki

I2S Mode

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.

🧩 Commands

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

📝 Notes

  • play generates square waves through I2S and supports both finite and interruptible playback.
  • record compresses and visualizes input signal strength in real-time.
  • test speaker plays:
    • A melody sequence
    • Frequency sweep
    • Binary test patterns
    • PCM playback
  • test mic reads microphone input, computes average signal energy, and confirms detection.
  • reset ensures output mode is restored after testing input.

📌 Example Usage

mode i2s
config                 # Set I2S pins and parameters
play 440 1000          # Play a 1 kHz 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

▶️ Demo

demo8

🔧 Hardware

sen-17-145-2-pcm5102-i2s-digital-audio-dac-decoding-module

Microphone-Omnidirectionnel-Tech-I2S-INMP441-Test-et-Avis

⚠️ **GitHub.com Fallback** ⚠️