pub struct VoiceChannel { /* private fields */ }Expand description
Voice channel adapter for continuous voice conversation.
Implements ChannelAdapter to integrate the voice pipeline
with the agent system. Status transitions are reported via an
mpsc channel for WebSocket broadcasting.
§Stub Behavior
This implementation is a stub. The start() method waits for
cancellation rather than processing real audio. The send()
method logs the outbound text that would be spoken via TTS.
Implementations§
Source§impl VoiceChannel
impl VoiceChannel
Sourcepub fn new() -> (Self, Receiver<VoiceStatus>)
pub fn new() -> (Self, Receiver<VoiceStatus>)
Create a new voice channel.
Returns the channel and a receiver for status updates. The receiver can be used to broadcast status changes to WebSocket clients.
Sourcepub async fn current_status(&self) -> VoiceStatus
pub async fn current_status(&self) -> VoiceStatus
Get the current voice status.
Trait Implementations§
Source§impl ChannelAdapter for VoiceChannel
impl ChannelAdapter for VoiceChannel
Source§fn start<'life0, 'async_trait>(
&'life0 self,
_host: Arc<dyn ChannelAdapterHost>,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
_host: Arc<dyn ChannelAdapterHost>,
cancel: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the voice channel loop.
In the real implementation this would:
- Start audio capture
- Run VAD to detect speech segments
- Feed speech to STT for transcription
- Deliver transcribed text to the agent pipeline via
host - Loop until cancelled
The stub simply sets status to Listening and waits for cancellation.
Source§fn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_target: &'life1 str,
payload: &'life2 MessagePayload,
) -> Pin<Box<dyn Future<Output = Result<String, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_target: &'life1 str,
payload: &'life2 MessagePayload,
) -> Pin<Box<dyn Future<Output = Result<String, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a message through the voice channel (TTS output).
In the real implementation this would synthesize the text via TTS and play it through the speaker. The stub logs the text and transitions status: Speaking -> Listening.