Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion audio-knife/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl SessionState {
}
};

let conversation_span = info_span!("", cid = %short_conversation_id);
let conversation_span = info_span!("conversation", cid = %short_conversation_id);
// We enter here, so that ContextSwitch picks the span up via `Span::current()`.
let entered_conversation_span = conversation_span.enter();

Expand Down
22 changes: 16 additions & 6 deletions services/azure/src/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use async_stream::stream;
use async_trait::async_trait;
use futures::StreamExt;
use serde::Deserialize;
use tracing::{error, info};
use tracing::{debug, error, info};

use azure_speech::recognizer::{self, Event};

Expand Down Expand Up @@ -128,17 +128,27 @@ impl Service for AzureTranscribe {

while let Some(event) = stream.next().await {
match event? {
Event::SessionStarted(_)
| Event::SessionEnded(_)
| Event::StartDetected(_, _)
| Event::EndDetected(_, _) => {}
Event::SessionStarted(_) | Event::SessionEnded(_) => {}
// StartDetected and EndDetected seem to be received only once per session. They are
// not usable for turn detection.
Event::StartDetected(request_id, offset) => {
debug!(?request_id, offset, "Start of speech detected (ignored)");
}
Event::EndDetected(request_id, offset) => {
debug!(?request_id, offset, "End of speech detected (ignored)");
}
Event::Recognizing(_, recognized, _, _, _) => {
output_recognized_text(&output, recognized, false, include_detected_language)?
}
Event::Recognized(_, recognized, _, _, _) => {
output_recognized_text(&output, recognized, true, include_detected_language)?
}
Event::UnMatch(_, _, _, _) => {}
Event::UnMatch(request_id, offset, duration, raw_message) => {
debug!(
?request_id,
offset, duration, raw_message, "Speech not recognized (ignored)"
);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions services/deepgram/src/transcribe.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::io;
use std::{io, result};

use anyhow::{Context, Result, anyhow, bail};
use async_trait::async_trait;
Expand Down Expand Up @@ -103,7 +103,7 @@ impl Service for DeepgramTranscribe {
let deepgram = Deepgram::with_base_url_and_api_key(endpoint.as_str(), params.api_key)?;

let (mut input, output) = conversation.start()?;
let (mut audio_tx, audio_rx) = mpsc::channel::<std::result::Result<Bytes, io::Error>>(8);
let (mut audio_tx, audio_rx) = mpsc::channel::<result::Result<Bytes, io::Error>>(8);

let mut stream = deepgram
.transcription()
Expand Down
Loading