Class InputAudioBufferAppendEvent
-
- All Implemented Interfaces:
public final class InputAudioBufferAppendEvent
Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary storage you can write to and later commit. In Server VAD mode, the audio buffer is used to detect speech and the server will decide when to commit. When Server VAD is disabled, you must commit the audio buffer manually.
The client may choose how much audio to place in each event up to a maximum of 15 MiB, for example streaming smaller chunks from the client may allow the VAD to be more responsive. Unlike made other client events, the server will not send a confirmation response to this event.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
InputAudioBufferAppendEvent.Builder
A builder for InputAudioBufferAppendEvent.
-
Method Summary
Modifier and Type Method Description final String
audio()
Base64-encoded audio bytes. final JsonValue
_type()
The event type, must be input_audio_buffer.append
.final Optional<String>
eventId()
Optional client-generated ID used to identify this event. final JsonField<String>
_audio()
Returns the raw JSON value of audio. final JsonField<String>
_eventId()
Returns the raw JSON value of eventId. final Map<String, JsonValue>
_additionalProperties()
final InputAudioBufferAppendEvent.Builder
toBuilder()
final InputAudioBufferAppendEvent
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static InputAudioBufferAppendEvent.Builder
builder()
Returns a mutable builder for constructing an instance of InputAudioBufferAppendEvent. -
-
Method Detail
-
audio
final String audio()
Base64-encoded audio bytes. This must be in the format specified by the
input_audio_format
field in the session configuration.
-
_type
final JsonValue _type()
The event type, must be
input_audio_buffer.append
.Expected to always return the following:
JsonValue.from("input_audio_buffer.append")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_audio
final JsonField<String> _audio()
Returns the raw JSON value of audio.
Unlike audio, this method doesn't throw if the JSON field has an unexpected type.
-
_eventId
final JsonField<String> _eventId()
Returns the raw JSON value of eventId.
Unlike eventId, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final InputAudioBufferAppendEvent.Builder toBuilder()
-
validate
final InputAudioBufferAppendEvent validate()
-
builder
final static InputAudioBufferAppendEvent.Builder builder()
Returns a mutable builder for constructing an instance of InputAudioBufferAppendEvent.
The following fields are required:
.audio()
-
-
-
-