Packages@robojs/ai
VoiceSessionStartOptions
Interface: VoiceSessionStartOptions
Configuration structure used when starting a managed voice session.
Example
await engine.startVoiceSession({
guildId: '123',
sessionId: 'voice-1',
channel: voiceChannel,
frameSource: microphoneStream,
configuration: {
endpointing: 'server-vad',
targetSampleRate: 16000
}
})Properties
| Property | Type | Description |
|---|---|---|
channel | null | VoiceBasedChannel | Voice channel to join for playback. |
configuration | { endpointing: VoiceEndpointingStrategy; maxSilenceMs: number; model: string; playbackVoice: null | string; realtimeApiKey: null | string; targetSampleRate: number; } | Engine-specific configuration describing voice runtime behavior. |
configuration.endpointing | VoiceEndpointingStrategy | Endpointing strategy to use for speech detection. |
configuration.maxSilenceMs? | number | Maximum silence tolerated before auto-stopping (ms). |
configuration.model? | string | Optional override for the realtime model identifier. |
configuration.playbackVoice? | null | string | Voice name used for playback responses. |
configuration.realtimeApiKey? | null | string | API key for realtime services when required. |
configuration.targetSampleRate | number | Sample rate expected by the engine. |
conversation? | ConversationInput | Conversation metadata shared with chat flows. |
conversationKey? | string | Cache key used to resume prior voice sessions. |
frameSource | AsyncIterable<VoiceInputFrame, any, any> | Streaming source of microphone frames. |
guildId | string | Discord guild identifier hosting the session. |
member? | null | GuildMember | Guild member initiating the session, if any. |
onAudioDelta? | (delta: VoicePlaybackDelta) => void | Promise<void> | Callback invoked with generated playback audio chunks. |
onTranscription? | (segment: VoiceTranscriptSegment) => void | Promise<void> | Callback invoked whenever a new transcript segment is available. |
onWarning? | (warning: Error) => void | Promise<void> | Callback invoked when the engine emits a warning. |
sessionId | string | Unique session identifier generated by the caller. |
textChannel? | null | TextBasedChannel | Text channel used for transcription updates. |
transcriptTarget? | null | TextBasedChannel | Target text channel for transcripts or summaries. |
userId? | null | string | Discord user identifier associated with the session. |
