Freigeben über


InputAudioBufferResource Class

Resource for input audio buffer management.

Initialize an input audio buffer resource.

Constructor

InputAudioBufferResource(connection: VoiceLiveConnection)

Parameters

Name Description
connection
Required

The VoiceLiveConnection to use.

Methods

append

Append audio to the input buffer.

clear

Clear the input audio buffer.

commit

Commit the input audio buffer.

Creates a new user message item in the conversation.

append

Append audio to the input buffer.

async append(*, audio: str, event_id: str | None = None) -> None

Keyword-Only Parameters

Name Description
audio
str

Base64-encoded audio data in the format declared by the session config.

event_id
str

Optional ID for the event.

Default value: None

Returns

Type Description

clear

Clear the input audio buffer.

async clear(*, event_id: str | None = None) -> None

Keyword-Only Parameters

Name Description
event_id
str

Optional ID for the event.

Default value: None

Returns

Type Description

commit

Commit the input audio buffer.

Creates a new user message item in the conversation.

async commit(*, event_id: str | None = None) -> None

Keyword-Only Parameters

Name Description
event_id
str

Optional ID for the event.

Default value: None

Returns

Type Description