Write plain transcribed text

This commit is contained in:
Rafael Caricio 2022-03-31 14:27:57 +02:00
parent 398656f9f8
commit 93a27b4a02
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947

View file

@ -112,11 +112,13 @@ fn main() -> eyre::Result<()> {
Message::Text(payload) => { Message::Text(payload) => {
match serde_json::from_str::<Transcript>(&payload) { match serde_json::from_str::<Transcript>(&payload) {
Ok(transcript) => { Ok(transcript) => {
info!( let text = transcript
"result: {}", .result
serde_json::to_string_pretty(&transcript.result) .iter()
.unwrap() .map(|p| p.word.to_string())
); .collect::<Vec<_>>()
.join(" ");
info!("result: {}", text);
} }
Err(_) => { Err(_) => {
// The payload is still not a final transcript, so we just ignore it // The payload is still not a final transcript, so we just ignore it