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
channel
channel: any;
Voice channel to join for playback.
configuration
configuration: object;
Engine-specific configuration describing voice runtime behavior.
| Name | Type | Description |
|---|---|---|
endpointing | VoiceEndpointingStrategy | Endpointing strategy to use for speech detection. |
maxSilenceMs? | number | Maximum silence tolerated before auto-stopping (ms). |
model? | string | Optional override for the realtime model identifier. |
playbackVoice? | null | string | Voice name used for playback responses. |
realtimeApiKey? | null | string | API key for realtime services when required. |
targetSampleRate | number | Sample rate expected by the engine. |
conversation?
optional conversation: ConversationInput;
Conversation metadata shared with chat flows.
conversationKey?
optional conversationKey: string;
Cache key used to resume prior voice sessions.
frameSource
frameSource: AsyncIterable<VoiceInputFrame>;
Streaming source of microphone frames.
guildId
guildId: string;
Discord guild identifier hosting the session.
member?
optional member: any;
Guild member initiating the session, if any.
onAudioDelta()?
optional onAudioDelta: (delta) => void | Promise<void>;
Callback invoked with generated playback audio chunks.
Parameters
| Parameter | Type |
|---|---|
delta | VoicePlaybackDelta |
Returns
void | Promise<void>
onTranscription()?
optional onTranscription: (segment) => void | Promise<void>;
Callback invoked whenever a new transcript segment is available.
Parameters
| Parameter | Type |
|---|---|
segment | VoiceTranscriptSegment |
Returns
void | Promise<void>
onWarning()?
optional onWarning: (warning) => void | Promise<void>;
Callback invoked when the engine emits a warning.
Parameters
| Parameter | Type |
|---|---|
warning | Error |
Returns
void | Promise<void>
sessionId
sessionId: string;
Unique session identifier generated by the caller.
textChannel?
optional textChannel: any;
Text channel used for transcription updates.
transcriptTarget?
optional transcriptTarget: any;
Target text channel for transcripts or summaries.
userId?
optional userId: null | string;
Discord user identifier associated with the session.