Write plain transcribed text
This commit is contained in:
parent
398656f9f8
commit
93a27b4a02
1 changed files with 7 additions and 5 deletions
12
src/main.rs
12
src/main.rs
|
@ -112,11 +112,13 @@ fn main() -> eyre::Result<()> {
|
|||
Message::Text(payload) => {
|
||||
match serde_json::from_str::<Transcript>(&payload) {
|
||||
Ok(transcript) => {
|
||||
info!(
|
||||
"result: {}",
|
||||
serde_json::to_string_pretty(&transcript.result)
|
||||
.unwrap()
|
||||
);
|
||||
let text = transcript
|
||||
.result
|
||||
.iter()
|
||||
.map(|p| p.word.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(" ");
|
||||
info!("result: {}", text);
|
||||
}
|
||||
Err(_) => {
|
||||
// The payload is still not a final transcript, so we just ignore it
|
||||
|
|
Loading…
Reference in a new issue