-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
As there is Diskussions are not enabled, I thought I "abuse" the Issues to say: Thank you!
I just play around at home currently and wanted to see how far I get using rust to get:
- Speech to Text
- Text to intent
- automate stuff
As I already have the last thing (automate) running since longer time but using Alexa, custom skill and AWS, I thought, let's see what is out there to have all running local and best all in rust. (I am not really good with rust, but I still like it).
I first found the more or less abandoned sonos snips-nlu project, but I really got everything compiled and running in the end.
Then I found vosk and also got it compiled and running.
The last missing thing was I wanted to have a websocket server that receives audio and translates it into text that can be used to get intents out of it.
This is where I found your posts and this repository.
Today I successfully integrated (or injected) Vosk into your already existing audio receiving here:
streamer-template/src/axum_server.rs
Line 163 in ec2586c
Message::Binary(audio) => { |
collecting the incoming data and use the WavWriter to recreate the audio file in memory.
reuse your audio decoding sample recreation code and could get Vosk to extract words out of the audio data (using https://ttsmp3.com/ to generate spoken text and using audacity to export the mp3 as Wav). 🚀
For developing I have all compiled under windows and plan to compile it later for armv7-unknown-linux-musleabihf.
I had some crashes / disconnects with the client I think here:
streamer-template/src/bin/client.rs
Line 151 in ec2586c
while let Some(res) = ws_rx.next().await { |
and modified it to this and had no crashes anymore, but don't know if this is any good:
use futures::{SinkExt, StreamExt, FutureExt};
...
while let Some(res_option) = ws_rx.next().now_or_never() {
match res_option {
Some(res) => {
let res_m = res?;
if let Message::Text(res_m) = res_m {
if first_instant.is_none() {
first_instant = Some(Instant::now().duration_since(start_instant));
}
info!("Got message: {}", res_m);
}
}
None => info!("Connection closed?"),
}
}