An ESP32 firmware for turning an I2S microphone into a small network audio source.
It was built for always-on outdoor/bird-audio use, especially with BirdNET-Go, but it also works with common players such as VLC and ffplay.
Tested on a Wemos D1 Mini32. Other ESP32 boards should work if the I2S pins are adjusted.
- Captures mono audio from an I2S MEMS microphone
- Streams live audio over:
- HTTP:
http://<device-ip>:81/stream.wav - RTSP/TCP:
rtsp://<device-ip>:8554/audio/
- HTTP:
- Provides a browser UI at
http://<device-ip>/ - Lets you configure Wi-Fi from a setup access point on first boot
- Includes BirdNET-Go-friendly audio profiles:
- Quality — 48 kHz
- Stability — 24 kHz
- Can optionally sleep at night and wake at civil dawn
Default I2S wiring:
| I2S signal | ESP32 GPIO |
|---|---|
| WS / LRCLK | 25 |
| BCK / SCK | 33 |
| SD / DOUT | 32 |
Default capture channel is right. You can change pins/channel in local_env.ini.
Use either the PlatformIO VS Code extension or the CLI.
cp local_env.ini.example local_env.iniEdit local_env.ini if needed for:
- I2S pins
- location/timezone
- deep sleep behavior
- optional Wi-Fi seed credentials
Wi-Fi credentials do not need to be hardcoded; the device can be configured from the setup web page.
pio run --target uploadpio device monitor -b 115200On first boot, if no saved Wi-Fi credentials exist, the ESP32 starts a setup access point.
Connect to:
ESP32-Audio-Setup-XXXXXX
Then open:
http://192.168.4.1/
Save your Wi-Fi credentials. The page and serial log will show the device IP after it connects.
http://<device-ip>/
From the UI you can:
- See stream status
- Play the HTTP stream
- Change audio profile
- Change HPF / gain conversion settings
- Restart audio
- Manage Wi-Fi
- View logs and system status
Recommended URLs:
| Use | URL |
|---|---|
| Browser / simple HTTP client | http://<device-ip>:81/stream.wav |
| Raw PCM HTTP client | http://<device-ip>:81/stream.pcm |
| BirdNET-Go / VLC / ffplay | rtsp://<device-ip>:8554/audio/ |
RTSP is TCP/interleaved only. If a client first tries UDP, the firmware rejects that setup and waits for a TCP RTSP setup.
Only one stream client can be active at a time.
Start with:
- URL:
rtsp://<device-ip>:8554/audio/ - Audio profile: Stability — 24 kHz if Wi-Fi is marginal
- Audio profile: Quality — 48 kHz if the stream is stable
The profile can be changed from the Audio page. After changing profile, click Restart Audio.
Build:
pio runUpload:
pio run --target uploadMonitor:
pio device monitor -b 115200Test RTSP with ffplay:
ffplay -rtsp_transport tcp rtsp://<device-ip>:8554/audio/Test HTTP WAV:
ffplay http://<device-ip>:81/stream.wavDetailed information has been moved out of this README:
This project was influenced by BirdNET-Go ESP32 microphone work from the community, especially: