I have a Esp32 running a server program, and on my webpage I can click a button that will play a .wav sound strored in the Esp32 using spiffs, simple enough.
I can change the .wav sound file in the program.
What I'd like to do is listen to a microphone connected to the Esp on said wepage live (delay acceptable).
As I understand it the wav file contains a header which defines things like sample rate, file ID, stereo/mono and filesize.
I was wondering if I could find a way to make the filesize either several minutes long or continuous, and send audio data via html or a websocket.
There seems to be little info on the net about sending audio from an Esp to a browser.
Hi there, while working on the ARM Cortex-M0 side of this story together with @wjmb, this also came to mind: Looking forward to your feedback! With kind regards, Andreas. [1] GitHub - hiveeyes/saraswati: Saraswati is a robust, multi-channel audio recording, transmission and storage system
I have played with the voice streamer, I think it works, not sure as it sends raw data to a raspberry, not a browser.
Seems like the way to do this is to use the atod with dma.
However the total lack of any sign of it being done makes me think the esp32 isnt the device for the job.
I made an assumption that the chip could do it as the esp eye has a mems mic built in, however I couldnt find anything were the audio is streamed to a browser, just code that is triggered by sound.
If I was to go ahead with this then I think I'd need a more powerful chip, a codec or some other hardware.
I had visions of connecting something like this to a vintage comms receiver & be able to operate it over the net.
Thanks for that.
There is a version of the Esp32 called a Lyra T, it has a audio codec on board, and has the capability of streaming audio over the net, however its failry new and theres no examples for using it as an audio streaming server yet.
I think the reason why this isnt done with the esp is unlike video if an audio stream is interrupted the result is annoying, whereas a gap in video isnt so bad.
I think it is possible.
I have a program that records .wav files using the analogue port, and a program that plays files back.
The issue is that browsers want to download the entire .wav before playing it, but I found a control preload = none, this will make a browser play sound when its got enough data to start playing, before the entire file loads.
The max file size is 4gb, at 8kc sample rate thats a long time.
I'm going to try modding the .wav record code so that it generates the header as usual and sends it to the browser, then grabs a block of samples then bungs it direct to the browser and repeats in a loop until the 4gigs is up, then ask the user if they want to re-start.