Class: RunApi::Suno::Resources::GenerateVoice
- Inherits:
-
Object
- Object
- RunApi::Suno::Resources::GenerateVoice
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/suno/resources/generate_voice.rb
Overview
Step 3 of voice cloning: trains a custom voice from the user's recording of the validation phrase.
Constant Summary collapse
- ENDPOINT =
"/api/v1/suno/generate_voice"- RESPONSE_CLASS =
Types::VoiceGenerationResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedVoiceGenerationResponse
Instance Method Summary collapse
- #create(options: nil, **params) ⇒ Object
- #get(id, options: nil) ⇒ Object
-
#initialize(http) ⇒ GenerateVoice
constructor
A new instance of GenerateVoice.
- #run(options: nil, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ GenerateVoice
Returns a new instance of GenerateVoice.
14 15 16 |
# File 'lib/runapi/suno/resources/generate_voice.rb', line 14 def initialize(http) @http = http end |
Instance Method Details
#create(options: nil, **params) ⇒ Object
23 24 25 26 27 |
# File 'lib/runapi/suno/resources/generate_voice.rb', line 23 def create(options: nil, **params) params = compact_params(params) validate_params!(params) request(:post, ENDPOINT, body: params, options: ) end |
#get(id, options: nil) ⇒ Object
29 30 31 |
# File 'lib/runapi/suno/resources/generate_voice.rb', line 29 def get(id, options: nil) request(:get, "#{ENDPOINT}/#{id}", options: ) end |
#run(options: nil, **params) ⇒ Object
18 19 20 21 |
# File 'lib/runapi/suno/resources/generate_voice.rb', line 18 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |