Class: RunApi::Suno::Resources::VoiceToValidationPhrase
- Inherits:
-
Object
- Object
- RunApi::Suno::Resources::VoiceToValidationPhrase
- Includes:
- Core::ResourceHelpers
- Defined in:
- lib/runapi/suno/resources/voice_to_validation_phrase.rb
Overview
Step 1 of voice cloning: extracts a validation phrase from a voice recording for the user to re-record.
Constant Summary collapse
- ENDPOINT =
"/api/v1/suno/voice_to_validation_phrase"- RESPONSE_CLASS =
Types::ValidationPhraseResponse
- COMPLETED_RESPONSE_CLASS =
Types::CompletedValidationPhraseResponse
Instance Method Summary collapse
- #create(options: nil, **params) ⇒ Object
- #get(id, options: nil) ⇒ Object
-
#initialize(http) ⇒ VoiceToValidationPhrase
constructor
A new instance of VoiceToValidationPhrase.
- #run(options: nil, **params) ⇒ Object
Constructor Details
#initialize(http) ⇒ VoiceToValidationPhrase
Returns a new instance of VoiceToValidationPhrase.
14 15 16 |
# File 'lib/runapi/suno/resources/voice_to_validation_phrase.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/voice_to_validation_phrase.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/voice_to_validation_phrase.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/voice_to_validation_phrase.rb', line 18 def run(options: nil, **params) task = create(options: , **params) poll_until_complete { get(task.id, options: ) } end |