Audio to web - #70
Conversation
works locally.. but not on device
|
That's an interesting concept. Will take a look! |
bigger audio buffer change from 16bit audio to 8bit some refactoring
|
Can you provide some higher level overview on how this works? |
|
At the esp level I've just copied your recording function (and structure/task/way of activating) so it sends the data over ws. I have created a version of your ws send to send binary data (but there is some error somewhere because sometimes the packets are corrupt and ws connection closes [on the client side], didn't have time to check it better but I suspect it has to do with the way the buffers are treated. At the web side its only a websocket that receives the data and buffers it so it can be played (with some "apaños" because it wasn't detecting the binary data right). The sum of squares its only to show the volume in a progress bar, the only needed operation its converting from int values to -1.0/1.0 ones so audiocontext can understand (the /128 in the current version). |
|
Thanks for the explanation. Makes a lot of sense. I haven't tried it yet, but will do soon! |
|
I tested it and it looks good so far. Hope you can make it work from the device. The audio was glitching for me, but I guess that is part of the WIP. Really like the idea and hope you can make it work. It would make a fine addition to the feature set of ESPRI. Good luck! |
|
The glitching is caused by the websocket closing, I'm hoping to correct it... |
|
This might be irrelevant, but I noticed a lot of log messages being output over serial during audio listening. Perhaps disabling these might help? |
|
it should not affect as the sound is processed in background in another thread the sttutering is mostly caused by the websocket closing (maybe 1% of the ocassions is network speed/lag/cuts, TCP its not the best transport for this but... mostly the closing) |
|
Hey I know this is old, but I just watched this and at the end there is a audio to websocket shown just like with your application. The author mentioned that you need a browser plugin in order to get more speed via HTTP over local connection. Maybe this helps? Here is the video: https://www.youtube.com/watch?v=0jR-QNTfydA |
This is not intended to merge to main.
Its a work in progress so the app can receive and play audio sent from the radio via websockets (raw pcm…).
For now it works with an standalone example (soundWs/index.html) from your local computer, and I have started to implement it in the vue app but for now it only works locally, not from the device (but as I dont have any idea of how to program in Vue... it'll have to do for today)
(and, of course, it needs to have a loooooot of optimizations, as I said: very WIP but W)