Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MicroPython
  3. micropython-i2s-examples

micropython-i2s-examples

MITPython

A collection of MicroPython examples for using the I2S protocol to play and record audio on microcontrollers.

GitHubGitHub
302 stars45 forks0 contributors

What is micropython-i2s-examples?

MicroPython I2S Examples is a collection of code samples that demonstrate how to use the I2S protocol for audio playback and recording on MicroPython-supported microcontrollers. It solves the problem of implementing digital audio on embedded devices by providing tested examples for common hardware like the ESP32, Raspberry Pi Pico, and Teensy boards.

Target Audience

Embedded developers and hobbyists working with MicroPython on microcontrollers who need to add audio playback or recording capabilities to their projects.

Value Proposition

Developers choose this project because it offers practical, hardware-tested examples across multiple platforms, reducing the trial-and-error typically associated with I2S audio implementation on microcontrollers.

Overview

Examples for I2S support on microcontrollers that run MicroPython

Use Cases

Best For

  • Playing WAV audio files through speakers on MicroPython boards
  • Recording microphone audio to SD cards on embedded systems
  • Adding audio feedback to IoT devices using ESP32 or Raspberry Pi Pico
  • Prototyping digital audio projects with I2S DACs and amplifiers
  • Learning I2S protocol implementation on microcontrollers
  • Building embedded systems with audio playback or recording features

Not Ideal For

  • Projects requiring compressed audio formats like MP3 or AAC
  • Real-time audio processing with low latency demands
  • Teams using Arduino or non-MicroPython firmware ecosystems
  • Minimalist setups without SD card storage or external hardware components

Pros & Cons

Pros

Cross-Platform Compatibility

Supports four MicroPython ports (stm32, esp32, rp2, mimxrt), providing versatile code that works across popular microcontroller families like ESP32 and Raspberry Pi Pico.

Hardware-Verified Examples

Includes tested configurations for common boards, DACs, and microphones, such as the INMP441 and PCM5102, reducing guesswork and ensuring reliability.

Practical Buffer Guidance

Offers specific FAQ advice on internal and user buffer sizing to prevent audio gaps, based on real-world testing with WAV playback and recording.

Detailed Wiring Guides

Provides clear pin mapping tables and images for hardware connections, ensuring correct setups with recommended wire types and lengths for optimal audio quality.

Cons

WAV-Only Audio Format

Limited to uncompressed WAV files, requiring conversion from MP3 or other formats and increasing storage needs, which can be cumbersome for projects with space constraints.

Complex Multi-Port Code Structure

Examples contain port-specific blocks (e.g., for stm32, esp32), making them lengthy and harder to simplify for a single board, as noted in the README about large files.

External SD Card Dependency

Many examples require SD cards for WAV playback, adding hardware cost and setup complexity, especially for boards like Raspberry Pi Pico that need external modules.

Non-Standard Hardware Workarounds

Certain devices, such as the SPH0645LM4H microphone, require manual bit-shifting due to non-standard I2S timing, adding extra steps and potential for errors.

Frequently Asked Questions

Quick Stats

Stars302
Forks45
Contributors0
Open Issues13
Last commit1 year ago
CreatedSince 2021

Tags

#embedded-audio#micropython#esp32#teensy#microcontroller#pyboard#i2s#raspberry-pi-pico#i2s-audio#stm32#i2s-dac#audio-recording#audio

Built With

M
MicroPython

Included in

MicroPython1.8k
Auto-fetched 1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub