> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Voice

> Public voice signatures and configuration in @agentium/core 4.0.0.

Import these **45 exports** from `@agentium/core`. Read the [voice guide](/voice/overview) for setup and behavior, or return to the [package reference](/api-reference/core).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## AudioFormat

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type AudioFormat = "pcm16" | "g711_ulaw" | "g711_alaw";
```

## audioFormatToGa

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/openai-session.ts)

```typescript theme={null}
export declare function audioFormatToGa(fmt?: AudioFormat): {
    type: string;
    rate?: number;
};
```

Related: [`AudioFormat`](/api-reference/core/voice#audioformat).

## BargeInPolicy

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
/** Whether user speech cancels the current spoken reply. */
export type BargeInPolicy = "always" | "never";
```

## buildOpenAIRealtimeSession

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/openai-session.ts)

```typescript theme={null}
/** GA `session.update` body (`session.type: "realtime"`). */
export declare function buildOpenAIRealtimeSession(modelId: string, config: RealtimeSessionConfig): Record<string, unknown>;
```

Related: [`RealtimeSessionConfig`](/api-reference/core/voice#realtimesessionconfig).

## ClientSecretOpts

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/realtime-http.ts)

```typescript theme={null}
/**
 * OpenAI Realtime REST helpers — ephemeral browser keys and WebRTC call creation.
 * https://developers.openai.com/api/docs/guides/realtime
 */
export interface ClientSecretOpts {
    apiKey?: string;
    signal?: AbortSignal;
    baseURL?: string;
    model?: string;
    /** Hashed end-user id for OpenAI safety enforcement. */
    safetyIdentifier?: string;
    expiresAfterSeconds?: number;
}
```

## ClientSecretResult

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/realtime-http.ts)

```typescript theme={null}
export interface ClientSecretResult {
    value: string;
    expiresAt?: number;
    raw: unknown;
}
```

## createRealtimeCall

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/realtime-http.ts)

```typescript theme={null}
export declare function createRealtimeCall(opts?: RealtimeCallOpts): Promise<{
    id: string;
    sdp: string;
    raw: unknown;
}>;
```

Related: [`RealtimeCallOpts`](/api-reference/core/voice#realtimecallopts).

## createRealtimeClientSecret

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/realtime-http.ts)

```typescript theme={null}
export declare function createRealtimeClientSecret(opts?: ClientSecretOpts): Promise<ClientSecretResult>;
```

Related: [`ClientSecretOpts`](/api-reference/core/voice#clientsecretopts), [`ClientSecretResult`](/api-reference/core/voice#clientsecretresult).

## CreateResponseOpts

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface CreateResponseOpts {
    instructions?: string;
    /** `"none"` = out-of-band (not stored on the conversation). */
    conversation?: "none" | "auto";
    modalities?: Array<"text" | "audio">;
}
```

## DEFAULT\_REALTIME\_MODEL

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/openai-session.ts)

```typescript theme={null}
export declare const DEFAULT_REALTIME_MODEL = "gpt-realtime-2.1";
```

## DEFAULT\_TRANSCRIPTION\_MODEL

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/openai-session.ts)

```typescript theme={null}
export declare const DEFAULT_TRANSCRIPTION_MODEL = "gpt-transcribe";
```

## GoogleLiveConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/providers/google-live.ts)

```typescript theme={null}
export interface GoogleLiveConfig {
    apiKey?: string;
}
```

## GoogleLiveProvider

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/providers/google-live.ts)

```typescript theme={null}
export declare class GoogleLiveProvider implements RealtimeProvider {
    readonly providerId = "google-live";
    readonly capabilities: {
        manualCommit: boolean;
        images: boolean;
        asyncTools: boolean;
        transcripts: boolean;
        resume: boolean;
        recovery: "session-resumption";
        inputSampleRateHz: number;
        outputSampleRateHz: number;
    };
    readonly modelId: string;
    constructor(modelId?: string, config?: GoogleLiveConfig);
    connect(config: RealtimeSessionConfig): Promise<RealtimeConnection>;
}
```

Related: [`GoogleLiveConfig`](/api-reference/core/voice#googleliveconfig), [`RealtimeConnection`](/api-reference/core/voice#realtimeconnection), [`RealtimeProvider`](/api-reference/core/voice#realtimeprovider), [`RealtimeSessionConfig`](/api-reference/core/voice#realtimesessionconfig).

## NoiseReductionConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface NoiseReductionConfig {
    type: "near_field" | "far_field";
}
```

## OpenAIRealtimeConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/providers/openai-realtime.ts)

```typescript theme={null}
export interface OpenAIRealtimeConfig {
    apiKey?: string;
    baseURL?: string;
}
```

## OpenAIRealtimeProvider

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/providers/openai-realtime.ts)

```typescript theme={null}
export declare class OpenAIRealtimeProvider implements RealtimeProvider {
    readonly providerId = "openai-realtime";
    readonly capabilities: {
        manualCommit: boolean;
        images: boolean;
        asyncTools: boolean;
        transcripts: boolean;
        resume: boolean;
        recovery: "fresh";
        inputSampleRateHz: number;
        outputSampleRateHz: number;
    };
    readonly modelId: string;
    constructor(modelId?: string, config?: OpenAIRealtimeConfig);
    connect(config: RealtimeSessionConfig): Promise<RealtimeConnection>;
}
```

Related: [`OpenAIRealtimeConfig`](/api-reference/core/voice#openairealtimeconfig), [`RealtimeConnection`](/api-reference/core/voice#realtimeconnection), [`RealtimeProvider`](/api-reference/core/voice#realtimeprovider), [`RealtimeSessionConfig`](/api-reference/core/voice#realtimesessionconfig).

## RealtimeCallOpts

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/realtime-http.ts)

```typescript theme={null}
export interface RealtimeCallOpts {
    apiKey?: string;
    signal?: AbortSignal;
    baseURL?: string;
    model?: string;
    /** @deprecated Unsupported by the Realtime create-call endpoint; SIP uses a separate lifecycle. */
    sipUri?: string;
    sdp?: string;
    safetyIdentifier?: string;
}
```

## RealtimeConnection

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface RealtimeConnection {
    /** Native transports expose closure so a connect/close race cannot return an already dead session. */
    readonly connectionState?: "open" | "closed";
    /** Client owns OpenAI continuation; Gemini resumes when a tool response arrives. */
    readonly toolContinuation?: "client" | "provider";
    sendAudio(data: Buffer): void;
    sendText(text: string): void;
    sendImage(image: Buffer | string, opts?: {
        mimeType?: string;
        text?: string;
    }): void;
    sendToolResult(callId: string, result: string): void;
    createResponse(opts?: CreateResponseOpts): void;
    commitAudio(): void;
    interrupt(): void;
    close(): Promise<void>;
    on<K extends RealtimeEvent>(event: K, handler: (data: RealtimeEventMap[K]) => void): void;
    off<K extends RealtimeEvent>(event: K, handler: (data: RealtimeEventMap[K]) => void): void;
}
```

Related: [`CreateResponseOpts`](/api-reference/core/voice#createresponseopts), [`RealtimeEvent`](/api-reference/core/voice#realtimeevent), [`RealtimeEventMap`](/api-reference/core/voice#realtimeeventmap).

## RealtimeEvent

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type RealtimeEvent = keyof RealtimeEventMap;
```

Related: [`RealtimeEventMap`](/api-reference/core/voice#realtimeeventmap).

## RealtimeEventMap

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type RealtimeEventMap = {
    audio: {
        data: Buffer;
        mimeType?: string;
        generationId?: string;
    };
    text: {
        text: string;
    };
    transcript: {
        text: string;
        role: "user" | "assistant";
        segmentId?: string;
        kind?: "partial" | "final";
        generationId?: string;
    };
    tool_call: RealtimeToolCall;
    usage: {
        promptTokens: number;
        completionTokens: number;
        totalTokens: number;
    };
    interrupted: {};
    error: {
        error: Error;
    };
    connected: {};
    disconnected: {};
    idle: {};
    generation_start: {
        generationId: string;
    };
    turn_complete: {
        generationId?: string;
    };
    go_away: {
        timeLeft?: string;
    };
    session_resume: {
        handle?: string;
        resumable: boolean;
    };
    recovery: RealtimeRecoveryState;
};
```

Related: [`RealtimeRecoveryState`](/api-reference/core/voice#realtimerecoverystate), [`RealtimeToolCall`](/api-reference/core/voice#realtimetoolcall).

## RealtimeMcpServer

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface RealtimeMcpServer {
    serverLabel: string;
    serverUrl: string;
    headers?: Record<string, string>;
}
```

## RealtimeProvider

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface RealtimeProvider {
    readonly capabilities?: {
        manualCommit: boolean;
        images: boolean;
        asyncTools: boolean;
        transcripts: boolean;
        resume: boolean;
        /** Advertised recovery contract; absent means recovery is unsupported. */
        recovery?: "session-resumption" | "fresh";
        inputSampleRateHz: number;
        outputSampleRateHz: number;
    };
    readonly providerId: string;
    readonly modelId: string;
    connect(config: RealtimeSessionConfig): Promise<RealtimeConnection>;
}
```

Related: [`RealtimeConnection`](/api-reference/core/voice#realtimeconnection), [`RealtimeSessionConfig`](/api-reference/core/voice#realtimesessionconfig).

## RealtimeRecoveryContinuity

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type RealtimeRecoveryContinuity = "session-resumption" | "fresh";
```

## RealtimeRecoveryPolicy

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
/** Opt-in, bounded recovery. No audio, user input, or tool results are resent. */
export interface RealtimeRecoveryPolicy {
    /** Default: stop when a safe provider checkpoint is unavailable. Fresh loses conversation context. */
    fallback?: "stop" | "fresh";
    /** Total reconnect attempts over this logical session, including successful reconnects. Default: 3. */
    maxAttempts?: number;
    initialDelayMs?: number;
    maxDelayMs?: number;
    connectTimeoutMs?: number;
    /** Maximum elapsed time for one recovery incident, including backoff. Default: 30 seconds. */
    maxElapsedMs?: number;
}
```

## RealtimeRecoveryState

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface RealtimeRecoveryState {
    status: "recovering" | "recovered" | "failed";
    attempt: number;
    continuity?: RealtimeRecoveryContinuity;
    reason: "disconnected" | "go-away" | "unsafe-checkpoint" | "uncertain-tools" | "exhausted";
    /** Replacement sessions never replay output and require new user input before forwarding output. */
    requiresInput: boolean;
}
```

Related: [`RealtimeRecoveryContinuity`](/api-reference/core/voice#realtimerecoverycontinuity).

## RealtimeSessionConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface RealtimeSessionConfig {
    signal?: AbortSignal;
    /** Provider session checkpoint. Gemini only; handles must stay with their original owner/configuration. */
    sessionResumption?: {
        handle?: string;
    };
    instructions?: string;
    voice?: string;
    tools?: ToolDefinition[];
    inputAudioFormat?: AudioFormat;
    outputAudioFormat?: AudioFormat;
    turnDetection?: TurnDetectionConfig | null;
    temperature?: number;
    maxResponseOutputTokens?: number | "inf";
    apiKey?: string;
    reasoningEffort?: ReasoningEffort;
    transcriptionModel?: string;
    transcriptionContext?: OpenAITranscriptionContext;
    noiseReduction?: NoiseReductionConfig;
    mcpServers?: RealtimeMcpServer[];
    safetyIdentifier?: string;
    translation?: VoiceTranslationConfig;
}
```

Related: [`AudioFormat`](/api-reference/core/voice#audioformat), [`NoiseReductionConfig`](/api-reference/core/voice#noisereductionconfig), [`RealtimeMcpServer`](/api-reference/core/voice#realtimemcpserver), [`ReasoningEffort`](/api-reference/core/voice#reasoningeffort), [`ToolDefinition`](/api-reference/core/models#tooldefinition), [`TurnDetectionConfig`](/api-reference/core/voice#turndetectionconfig), [`VoiceTranslationConfig`](/api-reference/core/voice#voicetranslationconfig).

## RealtimeToolCall

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface RealtimeToolCall {
    id: string;
    name: string;
    arguments: string;
}
```

## ReasoningEffort

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
```

## SemanticVadConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface SemanticVadConfig {
    type: "semantic_vad";
    eagerness?: SemanticVadEagerness;
    createResponse?: boolean;
    interruptResponse?: boolean;
}
```

Related: [`SemanticVadEagerness`](/api-reference/core/voice#semanticvadeagerness).

## SemanticVadEagerness

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type SemanticVadEagerness = "low" | "medium" | "high" | "auto";
```

## ServerVadConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface ServerVadConfig {
    type: "server_vad";
    threshold?: number;
    prefixPaddingMs?: number;
    silenceDurationMs?: number;
    createResponse?: boolean;
    interruptResponse?: boolean;
    /** After this idle (ms) the model speaks (“still there?”). */
    idleTimeoutMs?: number;
}
```

## ToolCallBehavior

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
/** When to talk around a tool call. Long tools (browse_web) should not go silent. */
export type ToolCallBehavior = "silent" | "speakBefore" | "speakAfter" | "speakBeforeAndAfter";
```

## TurnDetectionConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type TurnDetectionConfig = ServerVadConfig | SemanticVadConfig;
```

Related: [`SemanticVadConfig`](/api-reference/core/voice#semanticvadconfig), [`ServerVadConfig`](/api-reference/core/voice#servervadconfig).

## turnDetectionToGa

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/openai-session.ts)

```typescript theme={null}
export declare function turnDetectionToGa(td: TurnDetectionConfig | null | undefined): Record<string, unknown> | null | undefined;
```

Related: [`TurnDetectionConfig`](/api-reference/core/voice#turndetectionconfig).

## VoiceAgent

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/voice-agent.ts)

```typescript theme={null}
export declare class VoiceAgent {
    readonly name: string;
    readonly approvalManager: ApprovalManager | null;
    get audioFormats(): {
        input: SpeechFormat;
        output: SpeechFormat;
    };
    get memory(): MemoryManager | null;
    constructor(config: VoiceAgentConfig);
    connect(opts?: {
        apiKey?: string;
        signal?: AbortSignal;
        tenantId?: string;
        runMode?: RunMode;
        sessionId?: string;
        userId?: string;
        /** Prior call transcript — appended to instructions (warm transfer). */
        resumeTranscript?: string;
    }): Promise<VoiceSession>;
    /**
     * Warm-transfer: close `from`, open a session on this agent with the same transcript.
     */
    handoff(from: VoiceSession, opts?: {
        apiKey?: string;
        userId?: string;
    }): Promise<VoiceSession>;
}
```

Related: [`ApprovalManager`](/api-reference/core/tools#approvalmanager), [`MemoryManager`](/api-reference/core/memory#memorymanager), [`RunMode`](/api-reference/core/tools#runmode), [`VoiceAgentConfig`](/api-reference/core/voice#voiceagentconfig), [`VoiceSession`](/api-reference/core/voice#voicesession).

## VoiceAgentConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface VoiceAgentConfig {
    approval?: ApprovalConfig;
    approvalManager?: ApprovalManager;
    executionPolicy?: ExecutionPolicy;
    name: string;
    provider: RealtimeProvider;
    /** Off by default. Recovery state is emitted on the VoiceSession `recovery` event. */
    recovery?: RealtimeRecoveryPolicy;
    instructions?: string;
    tools?: ToolDef[];
    voice?: string;
    /**
     * Turn detection. Default: `{ type: "semantic_vad", eagerness: "low" }`.
     * Pass `{ type: "server_vad" }` for silence-based VAD, or `null` for push-to-talk.
     */
    turnDetection?: TurnDetectionConfig | null;
    inputAudioFormat?: AudioFormat;
    outputAudioFormat?: AudioFormat;
    temperature?: number;
    maxResponseOutputTokens?: number | "inf";
    eventBus?: EventBus;
    logLevel?: LogLevel;
    memory?: UnifiedMemoryConfig;
    model?: ModelProvider;
    sessionId?: string;
    userId?: string;
    skills?: Array<Skill | string>;
    costTracker?: CostTracker;
    /** Realtime 2.x thinking depth. Default: `low`. */
    reasoningEffort?: ReasoningEffort;
    /** Input transcription model. Default: `gpt-transcribe` (native WebSocket sessions). */
    transcriptionModel?: string;
    transcriptionContext?: OpenAITranscriptionContext;
    noiseReduction?: NoiseReductionConfig;
    /** Remote MCP servers attached to the OpenAI Realtime session. */
    mcpServers?: RealtimeMcpServer[];
    safetyIdentifier?: string;
    translation?: VoiceTranslationConfig;
    /**
     * One client-owned continuation follows completed OpenAI tool calls.
     * Legacy speakBefore variants no longer create competing out-of-band responses.
     */
    toolCallBehavior?: ToolCallBehavior;
    /** User speech cancels the current reply. Default: `always`. */
    bargeIn?: BargeInPolicy;
    recording?: VoiceRecordingConfig;
}
```

Related: [`ApprovalConfig`](/api-reference/core/tools#approvalconfig), [`ApprovalManager`](/api-reference/core/tools#approvalmanager), [`AudioFormat`](/api-reference/core/voice#audioformat), [`BargeInPolicy`](/api-reference/core/voice#bargeinpolicy), [`CostTracker`](/api-reference/core/cost#costtracker), [`EventBus`](/api-reference/core/events#eventbus), [`ExecutionPolicy`](/api-reference/core/tools#executionpolicy), [`LogLevel`](/api-reference/core/logger#loglevel), [`ModelProvider`](/api-reference/core/models#modelprovider), [`NoiseReductionConfig`](/api-reference/core/voice#noisereductionconfig), [`RealtimeMcpServer`](/api-reference/core/voice#realtimemcpserver), [`RealtimeProvider`](/api-reference/core/voice#realtimeprovider).

## VoicePipeline

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/pipeline.ts)

```typescript theme={null}
export declare class VoicePipeline {
    get migrationDiagnostics(): VoiceMigrationDiagnostic[];
    constructor(config: VoicePipelineConfig);
    transcribe(audio: Buffer, mimeType?: string, signal?: AbortSignal): Promise<string>;
    speak(text: string, signal?: AbortSignal): Promise<Buffer>;
    turn(audio: Buffer, mimeType?: string, signal?: AbortSignal): Promise<VoicePipelineTurn>;
}
```

Related: [`VoicePipelineConfig`](/api-reference/core/voice#voicepipelineconfig), [`VoicePipelineTurn`](/api-reference/core/voice#voicepipelineturn).

## VoicePipelineConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/pipeline.ts)

```typescript theme={null}
/**
 * Chained STT → LLM → TTS turn. Use when you do not want a single
 * speech-to-speech realtime model (Deepgram/Cartesia-style stack).
 * Talks to OpenAI's file transcription + speech endpoints.
 */
export interface VoicePipelineConfig {
    llm: ModelProvider;
    apiKey?: string;
    baseURL?: string;
    sttModel?: string;
    transcriptionContext?: OpenAITranscriptionContext;
    fetch?: typeof fetch;
    ttsModel?: string;
    voice?: string;
    instructions?: string;
}
```

Related: [`ModelProvider`](/api-reference/core/models#modelprovider).

## VoicePipelineTurn

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/pipeline.ts)

```typescript theme={null}
export interface VoicePipelineTurn {
    transcript: string;
    reply: string;
    audio: Buffer;
}
```

## VoiceRecording

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface VoiceRecording {
    output: Buffer;
    input: Buffer;
}
```

## VoiceRecordingConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface VoiceRecordingConfig {
    output?: boolean;
    input?: boolean;
}
```

## VoiceSession

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface VoiceSession {
    sendAudio(data: Buffer): void;
    sendText(text: string): void;
    sendImage(image: Buffer | string, opts?: {
        mimeType?: string;
        text?: string;
    }): void;
    commitAudio(): void;
    interrupt(): void;
    close(): Promise<void>;
    /** Playback-confirmed projection; unacknowledged generated text is marked unknown. */
    acknowledgePlayback?(ack: PlaybackAck): void;
    getTranscript(): string;
    getRecording(): VoiceRecording;
    on<K extends VoiceSessionEvent>(event: K, handler: (data: VoiceSessionEventMap[K]) => void): this;
    off<K extends VoiceSessionEvent>(event: K, handler: (data: VoiceSessionEventMap[K]) => void): this;
}
```

Related: [`VoiceRecording`](/api-reference/core/voice#voicerecording), [`VoiceSessionEvent`](/api-reference/core/voice#voicesessionevent), [`VoiceSessionEventMap`](/api-reference/core/voice#voicesessioneventmap).

## VoiceSessionEvent

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type VoiceSessionEvent = keyof VoiceSessionEventMap;
```

Related: [`VoiceSessionEventMap`](/api-reference/core/voice#voicesessioneventmap).

## VoiceSessionEventMap

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export type VoiceSessionEventMap = RealtimeEventMap & {
    tool_call_start: {
        name: string;
        args: unknown;
    };
    tool_result: {
        name: string;
        result: string;
    };
};
```

Related: [`RealtimeEventMap`](/api-reference/core/voice#realtimeeventmap).

## VoiceTranslationConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/voice/types.ts)

```typescript theme={null}
export interface VoiceTranslationConfig {
    /** Hint the model to translate speech into this language (BCP-47 or name). */
    targetLanguage: string;
}
```

## Supporting types

These local shapes appear in public signatures but are not named exports of this entrypoint.

### OpenAITranscriptionContext

```typescript theme={null}
/** Context for the current GPT transcription models, not conversation instructions. */
export interface OpenAITranscriptionContext {
    prompt?: string;
    keywords?: readonly string[];
    languages?: readonly string[];
}
```

### SpeechFormat

```typescript theme={null}
export interface SpeechFormat {
    encoding: SpeechEncoding;
    sampleRateHz: number;
    channels: 1;
}
```

### SpeechEncoding

```typescript theme={null}
export type SpeechEncoding = "pcm_s16le" | "mulaw" | "alaw";
```

### VoiceMigrationDiagnostic

```typescript theme={null}
export interface VoiceMigrationDiagnostic {
    code: "transcription-model-deprecated" | "tts-snapshot-deprecated" | "prompt-object-deprecated";
    message: string;
    shutdownDate: string;
    source: string;
    verifiedAt: string;
}
```

### PlaybackAck

```typescript theme={null}
export interface PlaybackAck {
    generationId: string;
    playedCharacters?: number;
    complete?: boolean;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.