runapi-suno 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -8
- data/lib/runapi/suno/client.rb +53 -11
- data/lib/runapi/suno/contract_gen.rb +744 -0
- data/lib/runapi/suno/resources/add_instrumental.rb +8 -7
- data/lib/runapi/suno/resources/add_vocals.rb +8 -7
- data/lib/runapi/suno/resources/boost_style.rb +3 -2
- data/lib/runapi/suno/resources/check_voice.rb +3 -2
- data/lib/runapi/suno/resources/convert_audio.rb +8 -7
- data/lib/runapi/suno/resources/cover_audio.rb +8 -7
- data/lib/runapi/suno/resources/create_mashup.rb +8 -7
- data/lib/runapi/suno/resources/extend_music.rb +8 -7
- data/lib/runapi/suno/resources/generate_artwork.rb +8 -7
- data/lib/runapi/suno/resources/generate_lyrics.rb +8 -7
- data/lib/runapi/suno/resources/generate_midi.rb +8 -7
- data/lib/runapi/suno/resources/generate_persona.rb +3 -2
- data/lib/runapi/suno/resources/generate_voice.rb +8 -7
- data/lib/runapi/suno/resources/get_timestamped_lyrics.rb +3 -2
- data/lib/runapi/suno/resources/regenerate_validation_phrase.rb +8 -7
- data/lib/runapi/suno/resources/replace_section.rb +8 -7
- data/lib/runapi/suno/resources/separate_audio_stems.rb +8 -7
- data/lib/runapi/suno/resources/text_to_music.rb +8 -7
- data/lib/runapi/suno/resources/text_to_sound.rb +8 -7
- data/lib/runapi/suno/resources/visualize_music.rb +8 -7
- data/lib/runapi/suno/resources/voice_to_validation_phrase.rb +8 -7
- data/lib/runapi/suno/types.rb +40 -0
- data/lib/runapi/suno/validators.rb +37 -45
- data/lib/runapi/suno.rb +1 -0
- metadata +11 -8
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates and adds an instrumental backing track to uploaded audio.
|
|
6
7
|
class AddInstrumental
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates and adds vocals to an uploaded instrumental track.
|
|
6
7
|
class AddVocals
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates style/genre tags from a text description for use in style fields. Synchronous (run only).
|
|
6
7
|
class BoostStyle
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -13,10 +14,10 @@ module RunApi
|
|
|
13
14
|
@http = http
|
|
14
15
|
end
|
|
15
16
|
|
|
16
|
-
def run(**params)
|
|
17
|
+
def run(options: nil, **params)
|
|
17
18
|
params = compact_params(params)
|
|
18
19
|
validate_params!(params)
|
|
19
|
-
request(:post, ENDPOINT, body: params)
|
|
20
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Step 4 of voice cloning: checks whether a custom voice is ready for use. Synchronous (run only).
|
|
6
7
|
class CheckVoice
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -13,10 +14,10 @@ module RunApi
|
|
|
13
14
|
@http = http
|
|
14
15
|
end
|
|
15
16
|
|
|
16
|
-
def run(**params)
|
|
17
|
+
def run(options: nil, **params)
|
|
17
18
|
params = compact_params(params)
|
|
18
19
|
validate_params!(params)
|
|
19
|
-
request(:post, ENDPOINT, body: params)
|
|
20
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Converts a generated track to WAV format.
|
|
6
7
|
class ConvertAudio
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Re-records vocals over an uploaded audio file with a new style or voice.
|
|
6
7
|
class CoverAudio
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Blends two audio tracks into a single new composition.
|
|
6
7
|
class CreateMashup
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Continues an existing track from a specified timestamp, inheriting or overriding its settings.
|
|
6
7
|
class ExtendMusic
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Creates cover artwork for an existing music task.
|
|
6
7
|
class GenerateArtwork
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Produces AI-generated lyrics from a text prompt.
|
|
6
7
|
class GenerateLyrics
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Extracts per-instrument MIDI note data from a generated track.
|
|
6
7
|
class GenerateMidi
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Creates a reusable style or voice persona from an existing track's vocals. Synchronous (run only).
|
|
6
7
|
class GeneratePersona
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -13,10 +14,10 @@ module RunApi
|
|
|
13
14
|
@http = http
|
|
14
15
|
end
|
|
15
16
|
|
|
16
|
-
def run(**params)
|
|
17
|
+
def run(options: nil, **params)
|
|
17
18
|
params = compact_params(params)
|
|
18
19
|
validate_params!(params)
|
|
19
|
-
request(:post, ENDPOINT, body: params)
|
|
20
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Step 3 of voice cloning: trains a custom voice from the user's recording of the validation phrase.
|
|
6
7
|
class GenerateVoice
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Retrieves word-level timing alignment for a track. Synchronous (run only, no create/get polling).
|
|
6
7
|
class GetTimestampedLyrics
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -13,10 +14,10 @@ module RunApi
|
|
|
13
14
|
@http = http
|
|
14
15
|
end
|
|
15
16
|
|
|
16
|
-
def run(**params)
|
|
17
|
+
def run(options: nil, **params)
|
|
17
18
|
params = compact_params(params)
|
|
18
19
|
validate_params!(params)
|
|
19
|
-
request(:post, ENDPOINT, body: params)
|
|
20
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Step 2 (optional) of voice cloning: requests a new, easier validation phrase.
|
|
6
7
|
class RegenerateValidationPhrase
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Re-generates a time range within an existing track with new lyrics and style.
|
|
6
7
|
class ReplaceSection
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Splits a track into individual instrument stems (vocals, drums, bass, guitar, etc.).
|
|
6
7
|
class SeparateAudioStems
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates songs from a text prompt with configurable vocal mode, style, and persona.
|
|
6
7
|
class TextToMusic
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates sound effects (not music) from a text description with optional looping and BPM control.
|
|
6
7
|
class TextToSound
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module RunApi
|
|
4
4
|
module Suno
|
|
5
5
|
module Resources
|
|
6
|
+
# Generates a music visualization video from an existing track.
|
|
6
7
|
class VisualizeMusic
|
|
7
8
|
include RunApi::Core::ResourceHelpers
|
|
8
9
|
|
|
@@ -14,19 +15,19 @@ module RunApi
|
|
|
14
15
|
@http = http
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
def run(**params)
|
|
18
|
-
task = create(**params)
|
|
19
|
-
poll_until_complete { get(task.id) }
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
20
21
|
end
|
|
21
22
|
|
|
22
|
-
def create(**params)
|
|
23
|
+
def create(options: nil, **params)
|
|
23
24
|
params = compact_params(params)
|
|
24
25
|
validate_params!(params)
|
|
25
|
-
request(:post, ENDPOINT, body: params)
|
|
26
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
def get(id)
|
|
29
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
29
|
+
def get(id, options: nil)
|
|
30
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
private
|