Module: Typecast::Models

Defined in:
lib/typecast/models.rb,
lib/typecast/timestamps.rb

Defined Under Namespace

Classes: AlignmentSegmentCharacter, AlignmentSegmentWord, CustomVoice, Output, OutputStream, PresetPrompt, Prompt, SmartPrompt, SubscriptionResponse, TTSRequest, TTSRequestStream, TTSResponse, TTSWithTimestampsResponse, VoiceV2, VoicesV2Filter

Constant Summary collapse

TTS_MODEL_V21 =
"ssfm-v21"
TTS_MODEL_V30 =
"ssfm-v30"
AUDIO_WAV =
"wav"
AUDIO_MP3 =
"mp3"
CLONING_MAX_FILE_SIZE =
25 * 1024 * 1024
CLONING_NAME_MAX_LENGTH =
30
LANGUAGE_CODES =
%w[
  eng kor jpn spa deu fra ita pol nld rus ell tam tgl fin zho slk ara hrv
  ukr ind dan swe msa ces por bul ron ben hin hun nan nor pan tha tur vie yue
].freeze

Class Method Summary collapse

Class Method Details

.compact(hash) ⇒ Object



211
212
213
# File 'lib/typecast/models.rb', line 211

def self.compact(hash)
  hash.reject { |_key, value| value.nil? }
end

.value_to_h(value) ⇒ Object



215
216
217
218
219
# File 'lib/typecast/models.rb', line 215

def self.value_to_h(value)
  return nil if value.nil?
  return value.to_h if value.respond_to?(:to_h)
  value
end