Class: Telnyx::Models::StreamServerEvent::AudioChunk

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/telnyx/models/stream_server_event.rb

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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(audio: nil, cached: nil, is_final: nil, text: nil, time_to_first_audio_frame_ms: nil, type: nil) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::StreamServerEvent::AudioChunk for more details.

Server-to-client frame containing a base64-encoded audio chunk.

Parameters:

  • audio (String, nil) (defaults to: nil)

    Base64-encoded audio data. May be ‘null` for providers that use `drop_concatenat

  • cached (Boolean) (defaults to: nil)

    Whether this audio was served from cache.

  • is_final (Boolean) (defaults to: nil)

    Always ‘false` for audio chunk frames.

  • text (String, nil) (defaults to: nil)

    The text segment that this audio chunk corresponds to.

  • time_to_first_audio_frame_ms (Integer) (defaults to: nil)

    Milliseconds from the start-of-speech request to the first audio frame. Only pre

  • type (Symbol, Telnyx::Models::StreamServerEvent::AudioChunk::Type) (defaults to: nil)

    Frame type identifier.



# File 'lib/telnyx/models/stream_server_event.rb', line 60

Instance Attribute Details

#audioString?

Base64-encoded audio data. May be ‘null` for providers that use `drop_concatenated_audio` mode (Telnyx Natural/NaturalHD, Rime, Minimax, MurfAI, Resemble) — in that case only streamed chunks carry audio.

Returns:

  • (String, nil)


27
# File 'lib/telnyx/models/stream_server_event.rb', line 27

optional :audio, String, nil?: true

#cachedBoolean?

Whether this audio was served from cache.

Returns:

  • (Boolean, nil)


33
# File 'lib/telnyx/models/stream_server_event.rb', line 33

optional :cached, Telnyx::Internal::Type::Boolean

#is_finalBoolean?

Always ‘false` for audio chunk frames.

Returns:

  • (Boolean, nil)


39
# File 'lib/telnyx/models/stream_server_event.rb', line 39

optional :is_final, Telnyx::Internal::Type::Boolean, api_name: :isFinal

#textString?

The text segment that this audio chunk corresponds to.

Returns:

  • (String, nil)


45
# File 'lib/telnyx/models/stream_server_event.rb', line 45

optional :text, String, nil?: true

#time_to_first_audio_frame_msInteger?

Milliseconds from the start-of-speech request to the first audio frame. Only present on the first audio chunk of a synthesis request.

Returns:

  • (Integer, nil)


52
# File 'lib/telnyx/models/stream_server_event.rb', line 52

optional :time_to_first_audio_frame_ms, Integer, api_name: :timeToFirstAudioFrameMs

#typeSymbol, ...

Frame type identifier.



58
# File 'lib/telnyx/models/stream_server_event.rb', line 58

optional :type, enum: -> { Telnyx::Models::StreamServerEvent::AudioChunk::Type }