transcription: crash--
This commit is contained in:
@@ -91,12 +91,15 @@ pub async fn start_transcription(mut mic_src: AudioInStream) -> TranscriptionCon
|
||||
let c = client.clone();
|
||||
let t = transcription_in.clone();
|
||||
tokio::spawn(async move {
|
||||
let response = c.audio().transcription().create(CreateTranscriptionRequest {
|
||||
if let Ok(response) = c.audio().transcription().create(CreateTranscriptionRequest {
|
||||
file: AudioInput { source: InputSource::Bytes { filename: "transcription.wav".into(), bytes } },
|
||||
model: "gpt-4o-mini-transcribe".into(),
|
||||
..Default::default()
|
||||
}).await.unwrap();
|
||||
t.send(response.text).await.unwrap();
|
||||
}).await {
|
||||
t.send(response.text).await.unwrap();
|
||||
} else {
|
||||
log::error!("Error with transcription");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user