Class: OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample

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

Defined Under Namespace

Modules: Type

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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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_sample:, consent:, name:, type: nil) ⇒ AudioSample

Returns a new instance of AudioSample.

Parameters:

  • audio_sample —

    The sample audio recording file. Maximum size is 10 MiB.

    Supported MIME types: audio/mpeg, audio/wav, audio/x-wav, audio/ogg, audio/aac, audio/flac, audio/webm, audio/mp4.

    String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

  • consent —

    The consent recording ID (for example, cons_1234).

  • name —

    The name of the new voice.

  • type (defaults to: nil) —

    The voice creation method. Defaults to audio_sample when omitted.

  • audio_sample: (OpenAI::Internal::file_input)
  • consent: (String)
  • name: (String)
  • type: (OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample::type_) (defaults to: nil)


# File 'lib/openai/models/audio/voice_create_params.rb', line 81

Instance Attribute Details

#audio_sample ⇒ OpenAI::Internal::file_input

The sample audio recording file. Maximum size is 10 MiB.

Supported MIME types: audio/mpeg, audio/wav, audio/x-wav, audio/ogg, audio/aac, audio/flac, audio/webm, audio/mp4.

String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

Returns:

  • (OpenAI::Internal::file_input)


61
# File 'lib/openai/models/audio/voice_create_params.rb', line 61

required :audio_sample, OpenAI::Internal::Type::FileInput

The consent recording ID (for example, cons_1234).

Returns:

  • (String)


67
# File 'lib/openai/models/audio/voice_create_params.rb', line 67

required :consent, String

#name ⇒ String

The name of the new voice.

Returns:

  • (String)


73
# File 'lib/openai/models/audio/voice_create_params.rb', line 73

required :name, String

#type ⇒ OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample::type_?

The voice creation method. Defaults to audio_sample when omitted.

Returns:

  • (OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample::type_, nil)


79
# File 'lib/openai/models/audio/voice_create_params.rb', line 79

optional :type, enum: -> { OpenAI::Audio::VoiceCreateParams::Body::AudioSample::Type }

Instance Method Details

#to_hash ⇒ { audio_sample: OpenAI::Internal::file_input, consent: String, name: String, ?type: OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample::type_ }

Returns:

  • ({ audio_sample: OpenAI::Internal::file_input, consent: String, name: String, ?type: OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample::type_ })


138
139
140
141
142
143
# File 'sig/openai/models/audio/voice_create_params.rbs', line 138

def to_hash: -> {
  audio_sample: OpenAI::Internal::file_input,
  consent: String,
  name: String,
  ?type: OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample::type_
}