Files
embassy/examples/stm32wba6/README_PCM.md
2026-01-10 14:16:15 -07:00

696 B

SD to SAI PCM Streaming

This example streams audio from SD card to SAI using raw PCM files.

File format

Raw PCM files (.pcm) must be:

  • Unsigned 16-bit little-endian
  • 48 kHz
  • Mono

Convert WAV to PCM

Use the Python helper:

python3 convert_wav.py input.wav output.pcm

If your WAV is not 48 kHz, resample it first (for example with ffmpeg):

ffmpeg -i input.wav -ar 48000 -ac 1 temp.wav

Then convert temp.wav to PCM with the script above.

Usage

  1. Copy a .pcm or .wav file to the root of the SD card.
  2. Flash and run:
cargo run --bin sdmmc_sai --release

The example plays the first .pcm or .wav file found in the SD card root.