Module: OpenAI::Models::Live::AudioFormat

Extended by:
Internal::Type::Union
Defined in:
lib/openai/models/live/audio_format.rb,
sig/openai/models/live/audio_format.rbs

Overview

Audio encoding and sample rate for audio sent and received over a Live WebSocket connection. WebRTC and SIP negotiate their media format separately.

Defined Under Namespace

Classes: AudioPCM, AudioPCMA, AudioPCMU

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variant_for_dump

Methods included from Internal::Util::SorbetRuntimeSupport

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

Methods included from Internal::Type::Converter

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

Class Method Details

.values ⇒ Array<Integer>

Returns:

  • (Array<Integer>)


# File 'lib/openai/models/live/audio_format.rb', line 53

.variants ⇒ Array(OpenAI::Models::Live::AudioFormat::AudioPCM, OpenAI::Models::Live::AudioFormat::AudioPCMU, OpenAI::Models::Live::AudioFormat::AudioPCMA)



# File 'lib/openai/models/live/audio_format.rb', line 104

Instance Method Details

#initialize(rate:, type: :"audio/pcmu") ⇒ Object

Raw, mono G.711 μ-law audio for a Live WebSocket connection.

Parameters:

  • rate (Integer) —

    Audio sample rate in hertz. G.711 audio uses 8000 Hz.

  • type (Symbol, :"audio/pcmu") (defaults to: :"audio/pcmu") —

    The audio encoding. Always audio/pcmu.



# File 'lib/openai/models/live/audio_format.rb', line 71