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) => {
|
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
|
||||||
|
|
Loading…
Reference in a new issue