Module: OpenAI::Models::Audio::SpeechCreateParams::Voice

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

Overview

The voice to use when generating the audio. Supported built-in voices are alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer, verse, marin, and cedar. You may also provide a custom voice object with an id, for example { "id": "voice_1234" }. Previews of the voices are available in the Text to speech guide.

Defined Under Namespace

Classes: ID

collapse

ALLOY =

Returns:

:alloy
ASH =

Returns:

:ash
BALLAD =

Returns:

:ballad
CORAL =

Returns:

:coral
ECHO =

Returns:

:echo
SAGE =

Returns:

:sage
SHIMMER =

Returns:

:shimmer
VERSE =

Returns:

:verse
MARIN =

Returns:

:marin
CEDAR =

Returns:

:cedar

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

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

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_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Class Method Details

.variantsArray(String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID)

Returns:



165
166
167
168
169
170
171
172
173
# File 'lib/openai/models/audio/speech_create_params.rb', line 165

define_sorbet_constant!(:Variants) do
  T.type_alias do
    T.any(
      String,
      OpenAI::Audio::SpeechCreateParams::Voice::TaggedSymbol,
      OpenAI::Audio::SpeechCreateParams::Voice::ID
    )
  end
end

Instance Method Details

#initialize(id:) ⇒ Object

Custom voice reference.

Parameters:

  • The custom voice ID, e.g. voice_1234.



# File 'lib/openai/models/audio/speech_create_params.rb', line 155


#self?.variants::Array[OpenAI::Models::Audio::SpeechCreateParams::voice]

Returns:



103
# File 'sig/openai/models/audio/speech_create_params.rbs', line 103

def self?.variants: -> ::Array[OpenAI::Models::Audio::SpeechCreateParams::voice]