I'm trying my first IoT project whereby I want to:
- have an electret microphone capture audio
- have an ESP8266 NodeMCU 12-E board submit captured audio to a remote server
- have a remote server receive the audio data using an MQTT server
- publish the audio data as a .WAV file on the server
I saw someone online demonstrate something similar in this YouTube video
https://www.youtube.com/watch?v=rU_Pw9Jb_PM
The author shared the project on github here
https://github.com/hjltu/esp8266-wifi-microphone
When I study the code, I think what I see is the author taking the value of analogRead(A) and appending it to some kind of string as a payload, which is then published to an MQTT server.
I see that the author expects the MQTT server or some other software to process the ESP8266 microphone audio data and output it as a .RAW file. This RAW file is eventually converted to a .WAV file with the help of ffmpeg.
My question is this: What command allows MQTT server to generate the .RAW file? Or is this done by an entirely different software? And it appears to me that for a single recording/audio file, the my_record() of esp8266-wifi-mic.ino file will send multiple payloads to the MQTT server. So how does the MQTT server know which published transmission belongs to which RAW file?