Skip to main content

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.

NameTypeDescription
endpointingVoiceEndpointingStrategyEndpointing strategy to use for speech detection.
maxSilenceMs?numberMaximum silence tolerated before auto-stopping (ms).
model?stringOptional override for the realtime model identifier.
playbackVoice?null | stringVoice name used for playback responses.
realtimeApiKey?null | stringAPI key for realtime services when required.
targetSampleRatenumberSample 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​

ParameterType
deltaVoicePlaybackDelta

Returns​

void | Promise<void>


onTranscription()?​

optional onTranscription: (segment) => void | Promise<void>;

Callback invoked whenever a new transcript segment is available.

Parameters​

ParameterType
segmentVoiceTranscriptSegment

Returns​

void | Promise<void>


onWarning()?​

optional onWarning: (warning) => void | Promise<void>;

Callback invoked when the engine emits a warning.

Parameters​

ParameterType
warningError

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.