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.
http://<device-ip>:81/stream.wavrtsp://<device-ip>:8554/audio/http://<device-ip>/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.ini
Edit local_env.ini if needed for:
Wi-Fi credentials do not need to be hardcoded; the device can be configured from the setup web page.
pio run --target upload
pio device monitor -b 115200
On 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:
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:
rtsp://<device-ip>:8554/audio/The profile can be changed from the Audio page. After changing profile, click Restart Audio.
Build:
pio run
Upload:
pio run --target upload
Monitor:
pio device monitor -b 115200
Test RTSP with ffplay:
ffplay -rtsp_transport tcp rtsp://<device-ip>:8554/audio/
Test HTTP WAV:
ffplay http://<device-ip>:81/stream.wav
Detailed information has been moved out of this README:
This project was influenced by BirdNET-Go ESP32 microphone work from the community, especially:
C
41.5%
C++
41.1%
HTML
16.7%
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.
http://<device-ip>:81/stream.wavrtsp://<device-ip>:8554/audio/http://<device-ip>/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.ini
Edit local_env.ini if needed for:
Wi-Fi credentials do not need to be hardcoded; the device can be configured from the setup web page.
pio run --target upload
pio device monitor -b 115200
On 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:
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:
rtsp://<device-ip>:8554/audio/The profile can be changed from the Audio page. After changing profile, click Restart Audio.
Build:
pio run
Upload:
pio run --target upload
Monitor:
pio device monitor -b 115200
Test RTSP with ffplay:
ffplay -rtsp_transport tcp rtsp://<device-ip>:8554/audio/
Test HTTP WAV:
ffplay http://<device-ip>:81/stream.wav
Detailed information has been moved out of this README:
This project was influenced by BirdNET-Go ESP32 microphone work from the community, especially:
C
41.5%
C++
41.1%
HTML
16.7%