Class: OpenAI::Models::Live::OutputAudioDeltaEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/output_audio_delta_event.rb,
sig/openai/models/live/output_audio_delta_event.rbs

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(delta:, end_ms: nil, start_ms: nil, type: :"session.output_audio.delta") ⇒ Object

An audio chunk generated by the Live model. Decode and play primary WebSocket chunks in delivery order using the configured session audio format. Sideband connections receive reflected output audio with timestamps.

Parameters:

  • delta (String)

    Base64-encoded raw audio. Primary WebSocket events use the session's configured format; reflected sideband events use mono PCM16LE at 24 kHz.

  • end_ms (Integer) (defaults to: nil)

    Exclusive session-relative end in milliseconds. Required on reflected sideband events; omitted on the primary WebSocket. Dropped output frames leave gaps between reflected ranges.

  • start_ms (Integer) (defaults to: nil)

    Inclusive session-relative start in milliseconds. Required on reflected sideband events; omitted on the primary WebSocket.

  • type (Symbol, :"session.output_audio.delta") (defaults to: :"session.output_audio.delta")

    The event type, always session.output_audio.delta.



# File 'lib/openai/models/live/output_audio_delta_event.rb', line 35

Instance Attribute Details

#deltaString

Base64-encoded raw audio. Primary WebSocket events use the session's configured format; reflected sideband events use mono PCM16LE at 24 kHz.

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/openai/models/live/output_audio_delta_event.rb', line 12

required :delta, String

#end_msInteger?

Exclusive session-relative end in milliseconds. Required on reflected sideband events; omitted on the primary WebSocket. Dropped output frames leave gaps between reflected ranges.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


26
# File 'lib/openai/models/live/output_audio_delta_event.rb', line 26

optional :end_ms, Integer

#start_msInteger?

Inclusive session-relative start in milliseconds. Required on reflected sideband events; omitted on the primary WebSocket.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


33
# File 'lib/openai/models/live/output_audio_delta_event.rb', line 33

optional :start_ms, Integer

#typeSymbol, :"session.output_audio.delta"

The event type, always session.output_audio.delta.

Parameters:

  • value (:"session.output_audio.delta")

Returns:

  • (Symbol, :"session.output_audio.delta")


18
# File 'lib/openai/models/live/output_audio_delta_event.rb', line 18

required :type, const: :"session.output_audio.delta"

Instance Method Details

#to_hash{

Returns:

  • ({)


32
# File 'sig/openai/models/live/output_audio_delta_event.rbs', line 32

def to_hash: -> {