Documentation
¶
Overview ¶
Package voice provides integration between OmniMeet and OmniVoice.
VoiceAgentParticipant wraps an AgentParticipant with OmniVoice STT/TTS capabilities, enabling AI agents to hear and speak in meetings.
This package uses omnivoice-core types directly, allowing seamless switching between providers (Deepgram, OpenAI, ElevenLabs, Google, etc.).
Index ¶
- func FromTTSResult(result *tts.SynthesisResult, targetSampleRate int) provider.AudioFrame
- func ToSTTFormat(frame provider.AudioFrame, targetSampleRate int) ([]byte, stt.TranscriptionConfig)
- type Config
- type TranscriptHandler
- type VoiceAgentParticipant
- func (v *VoiceAgentParticipant) OnTranscript(handler TranscriptHandler)
- func (v *VoiceAgentParticipant) Participant() provider.AgentParticipant
- func (v *VoiceAgentParticipant) Speak(ctx context.Context, text string) error
- func (v *VoiceAgentParticipant) SpeakStream(ctx context.Context, text string) error
- func (v *VoiceAgentParticipant) StartTranscribing(ctx context.Context, participantID string) error
- func (v *VoiceAgentParticipant) StartTranscribingAll(ctx context.Context) error
- func (v *VoiceAgentParticipant) StopTranscribing(participantID string)
- func (v *VoiceAgentParticipant) StopTranscribingAll()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromTTSResult ¶
func FromTTSResult(result *tts.SynthesisResult, targetSampleRate int) provider.AudioFrame
FromTTSResult converts an OmniVoice TTS result to a meeting AudioFrame.
func ToSTTFormat ¶
func ToSTTFormat(frame provider.AudioFrame, targetSampleRate int) ([]byte, stt.TranscriptionConfig)
ToSTTFormat converts a meeting AudioFrame to OmniVoice STT format.
Types ¶
type Config ¶
type Config struct {
// STTProvider is the speech-to-text provider (from omnivoice).
STTProvider stt.Provider
// TTSProvider is the text-to-speech provider (from omnivoice).
TTSProvider tts.Provider
// STTConfig configures speech-to-text.
STTConfig stt.TranscriptionConfig
// TTSConfig configures text-to-speech.
TTSConfig tts.SynthesisConfig
// OnTranscript is called when speech is transcribed.
OnTranscript TranscriptHandler
}
Config configures the VoiceAgentParticipant.
type TranscriptHandler ¶
TranscriptHandler is called when speech is transcribed.
type VoiceAgentParticipant ¶
type VoiceAgentParticipant struct {
// contains filtered or unexported fields
}
VoiceAgentParticipant wraps AgentParticipant with OmniVoice integration.
func NewVoiceAgentParticipant ¶
func NewVoiceAgentParticipant(participant provider.AgentParticipant, cfg Config) *VoiceAgentParticipant
NewVoiceAgentParticipant creates a new VoiceAgentParticipant.
func (*VoiceAgentParticipant) OnTranscript ¶
func (v *VoiceAgentParticipant) OnTranscript(handler TranscriptHandler)
OnTranscript sets the transcript handler.
func (*VoiceAgentParticipant) Participant ¶
func (v *VoiceAgentParticipant) Participant() provider.AgentParticipant
Participant returns the underlying AgentParticipant.
func (*VoiceAgentParticipant) Speak ¶
func (v *VoiceAgentParticipant) Speak(ctx context.Context, text string) error
Speak synthesizes text and publishes audio to the meeting.
func (*VoiceAgentParticipant) SpeakStream ¶
func (v *VoiceAgentParticipant) SpeakStream(ctx context.Context, text string) error
SpeakStream synthesizes text with streaming and publishes audio chunks.
func (*VoiceAgentParticipant) StartTranscribing ¶
func (v *VoiceAgentParticipant) StartTranscribing(ctx context.Context, participantID string) error
StartTranscribing begins real-time transcription of a participant's audio.
func (*VoiceAgentParticipant) StartTranscribingAll ¶
func (v *VoiceAgentParticipant) StartTranscribingAll(ctx context.Context) error
StartTranscribingAll begins transcription of all current participants.
func (*VoiceAgentParticipant) StopTranscribing ¶
func (v *VoiceAgentParticipant) StopTranscribing(participantID string)
StopTranscribing stops transcription of a participant's audio.
func (*VoiceAgentParticipant) StopTranscribingAll ¶
func (v *VoiceAgentParticipant) StopTranscribingAll()
StopTranscribingAll stops all active transcriptions.