Close

Streaming Audio from PC to ESP32 Analog-Out

A project log for ESP32 TNC and Audio Relay for HF/VHF Packet Radio

Wireless packet radio interface for HF/VHF/UHF transceivers, using ESP32 as KISS TNC or audio relay for use with soft modems

ryan-kinnettRyan Kinnett 05/27/2020 at 10:130 Comments

Short update on a significant breakthrough:  I worked out a reasonably reliable outgoing audio chain, using VBAN to send audio data packets over WiFi to the ESP32.  The ESP32 unpacks the audio stream and funnels the data into direct memory access buffers which i2s then pipes to an analog-out pin.  Ultimately this will serve as the conduit for sending packet data from SoundModem, running on the PC, over to the ESP32 and ultimately into the mic port of the VHF/UHF transceiver.

Demo code here:  https://github.com/rkinnett/ESP32-VBAN-Network-Audio-Player

That code could be useful for many things beyond my intended purpose.  An intercom system, for example, or an audio endpoint for streaming music or anything you want from your PC.  How about a drone-carried PA?  The ESP32's built-in DAC is only 8 bits, not good enough to serve as a network audio receiver for a legit HiFi stereo system, but I think I'll build one anyway, maybe using an off-the-shelf ESP32 audio dev board with higher resolution DACs and linear amplifiers.  That should integrate very easily with this method since I'm already using i2s.

I previously worked out audio sampling and streaming from ESP32 to PC to relay audio received from the radio to SoundModem for demodulation.  With these two pieces in place, I'm now ready to design a state machine to juggle transmit and receive modes.  The high-level switching logic should be simple, but I'm not sure how easy it will be to dynamically change i2s input/output modes on the fly..

Discussions