Class: RunApi::FishAudio::Resources::TextToSpeech

Inherits:
Object
  • Object
show all
Includes:
Core::ResourceHelpers
Defined in:
lib/runapi/fish_audio/resources/text_to_speech.rb

Overview

Generates RunAPI-managed MP3 speech from text.

Constant Summary collapse

ENDPOINT =
"/api/v1/fish_audio/text_to_speech"
RESPONSE_CLASS =
Types::TextToSpeechResponse

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ TextToSpeech

Returns a new instance of TextToSpeech.



13
14
15
# File 'lib/runapi/fish_audio/resources/text_to_speech.rb', line 13

def initialize(http)
  @http = http
end

Instance Method Details

#run(options: nil, **params) ⇒ Object



17
18
19
20
21
# File 'lib/runapi/fish_audio/resources/text_to_speech.rb', line 17

def run(options: nil, **params)
  params = compact_params(params)
  validate_contract!(CONTRACT["text-to-speech"], params)
  request(:post, ENDPOINT, body: params, options: options)
end