Class: RunApi::FishAudio::Resources::CreateVoice

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

Overview

Creates an account-owned reusable voice from source audio.

Constant Summary collapse

ENDPOINT =
"/api/v1/fish_audio/voices"
RESPONSE_CLASS =
Types::VoiceResponse

Instance Method Summary collapse

Constructor Details

#initialize(http) ⇒ CreateVoice

Returns a new instance of CreateVoice.



13
14
15
# File 'lib/runapi/fish_audio/resources/create_voice.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/create_voice.rb', line 17

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