runapi-suno 0.6.0 → 0.7.0
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 +1 -1
- data/lib/runapi/suno/client.rb +4 -1
- data/lib/runapi/suno/resources/text_to_speech.rb +34 -0
- data/lib/runapi/suno/types/completed_responses.rb +4 -0
- data/lib/runapi/suno/types.rb +8 -3
- data/lib/runapi/suno.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f39652bcca54d3338197e79279469e5cbb025ca5d863c691c571da32767db36
|
|
4
|
+
data.tar.gz: 04c78feee727c60a6e6fc6629bbda05328021f2bf4ec3ff73264d80d7c8f3607
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92c554cfd9903d986d0f68bb946bba66585803193bf5e905e96a233e4aa5f3760427976ab84d34bc0eedcd537011b670acee49b72ca1188ab0cb1da95ff034ed
|
|
7
|
+
data.tar.gz: 90f47b3f1cf743f493ceae229d22e8d502661cf83810b68409c8f96417007c9bb79908170366e73c0088777ac55918eff39812e78ed258010a390ecbe6fe7899
|
data/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Use Ruby keyword arguments and the `RunApi::Suno` error classes when building mu
|
|
|
35
35
|
- Model page: https://runapi.ai/models/suno
|
|
36
36
|
- SDK docs: https://runapi.ai/docs/resources/sdks
|
|
37
37
|
- Product docs: https://runapi.ai/docs/api/suno/text-to-music
|
|
38
|
-
- Pricing and rate limits: https://runapi.ai/models/suno/
|
|
38
|
+
- Pricing and rate limits: https://runapi.ai/models/suno/v6
|
|
39
39
|
- Provider comparison: https://runapi.ai/providers/suno
|
|
40
40
|
- Full catalog: https://runapi.ai/models
|
|
41
41
|
- Repository: https://github.com/runapi-ai/suno-sdk
|
data/lib/runapi/suno/client.rb
CHANGED
|
@@ -9,7 +9,7 @@ module RunApi
|
|
|
9
9
|
# client = RunApi::Suno::Client.new(api_key: "sk-your-api-key")
|
|
10
10
|
# result = client.text_to_music.run(
|
|
11
11
|
# prompt: "A chill lo-fi beat with soft vocals",
|
|
12
|
-
# model: "suno-
|
|
12
|
+
# model: "suno-v6"
|
|
13
13
|
# )
|
|
14
14
|
class Client < RunApi::Core::Client
|
|
15
15
|
# @return [Resources::TextToMusic] generates songs from a text prompt with configurable vocal mode, style, and persona
|
|
@@ -45,6 +45,8 @@ module RunApi
|
|
|
45
45
|
attr_reader :create_mashup
|
|
46
46
|
# @return [Resources::TextToSound] generates sound effects from a text description
|
|
47
47
|
attr_reader :text_to_sound
|
|
48
|
+
# @return [Resources::TextToSpeech] generates spoken audio
|
|
49
|
+
attr_reader :text_to_speech
|
|
48
50
|
# @return [Resources::VoiceToValidationPhrase] step 1 of voice cloning: extracts a validation phrase
|
|
49
51
|
attr_reader :voice_to_validation_phrase
|
|
50
52
|
# @return [Resources::RegenerateValidationPhrase] step 2 (optional) of voice cloning: requests a new phrase
|
|
@@ -95,6 +97,7 @@ module RunApi
|
|
|
95
97
|
@replace_section = Resources::ReplaceSection.new(http)
|
|
96
98
|
@create_mashup = Resources::CreateMashup.new(http)
|
|
97
99
|
@text_to_sound = Resources::TextToSound.new(http)
|
|
100
|
+
@text_to_speech = Resources::TextToSpeech.new(http)
|
|
98
101
|
@voice_to_validation_phrase = Resources::VoiceToValidationPhrase.new(http)
|
|
99
102
|
@regenerate_validation_phrase = Resources::RegenerateValidationPhrase.new(http)
|
|
100
103
|
@generate_voice = Resources::GenerateVoice.new(http)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RunApi
|
|
4
|
+
module Suno
|
|
5
|
+
module Resources
|
|
6
|
+
# Generates spoken audio from a description or an exact script.
|
|
7
|
+
class TextToSpeech
|
|
8
|
+
include RunApi::Core::ResourceHelpers
|
|
9
|
+
|
|
10
|
+
ENDPOINT = "/api/v1/suno/text_to_speech"
|
|
11
|
+
RESPONSE_CLASS = Types::TextToSpeechResponse
|
|
12
|
+
COMPLETED_RESPONSE_CLASS = Types::CompletedTextToSpeechResponse
|
|
13
|
+
|
|
14
|
+
def initialize(http)
|
|
15
|
+
@http = http
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def run(options: nil, **params)
|
|
19
|
+
task = create(options: options, **params)
|
|
20
|
+
poll_until_complete { get(task.id, options: options) }
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def create(options: nil, **params)
|
|
24
|
+
params = compact_params(params)
|
|
25
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def get(id, options: nil)
|
|
29
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -59,6 +59,10 @@ module RunApi
|
|
|
59
59
|
required :audios, [-> { Audio }]
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
+
class CompletedTextToSpeechResponse < TextToSpeechResponse
|
|
63
|
+
required :audios, [-> { Audio }]
|
|
64
|
+
end
|
|
65
|
+
|
|
62
66
|
class CompletedTextToSoundResponse < TextToSoundResponse
|
|
63
67
|
required :audios, [-> { SoundAudio }]
|
|
64
68
|
end
|
data/lib/runapi/suno/types.rb
CHANGED
|
@@ -4,10 +4,10 @@ module RunApi
|
|
|
4
4
|
module Suno
|
|
5
5
|
# Suno type definitions, response models, and enum constants.
|
|
6
6
|
module Types
|
|
7
|
-
# Suno music generation engine versions
|
|
8
|
-
MODELS = %w[suno-v6 suno-v6-wild suno-v6-mini
|
|
7
|
+
# Suno music generation engine versions (V6 family).
|
|
8
|
+
MODELS = %w[suno-v6 suno-v6-wild suno-v6-mini].freeze
|
|
9
9
|
# Model versions that support sound effect generation (subset of MODELS).
|
|
10
|
-
SOUND_MODELS = %w[suno-
|
|
10
|
+
SOUND_MODELS = %w[suno-v6].freeze
|
|
11
11
|
# Musical keys (major and minor) for sound effect generation.
|
|
12
12
|
SOUND_KEYS = %w[
|
|
13
13
|
Cm C#m Dm D#m Em Fm F#m Gm G#m Am A#m Bm
|
|
@@ -161,6 +161,11 @@ module RunApi
|
|
|
161
161
|
# Result of adding vocals to a track.
|
|
162
162
|
class AddVocalsResponse < TextToMusicResponse; end
|
|
163
163
|
|
|
164
|
+
# Result of a spoken audio generation task.
|
|
165
|
+
class TextToSpeechResponse < AsyncTaskResponse
|
|
166
|
+
optional :audios, [-> { Audio }]
|
|
167
|
+
end
|
|
168
|
+
|
|
164
169
|
# Result of a sound effect generation task (uses SoundAudio instead of Audio).
|
|
165
170
|
class TextToSoundResponse < AsyncTaskResponse
|
|
166
171
|
optional :audios, [-> { SoundAudio }]
|
data/lib/runapi/suno.rb
CHANGED
|
@@ -25,6 +25,7 @@ require_relative "suno/resources/get_timestamped_lyrics"
|
|
|
25
25
|
require_relative "suno/resources/replace_section"
|
|
26
26
|
require_relative "suno/resources/create_mashup"
|
|
27
27
|
require_relative "suno/resources/text_to_sound"
|
|
28
|
+
require_relative "suno/resources/text_to_speech"
|
|
28
29
|
require_relative "suno/resources/voice_to_validation_phrase"
|
|
29
30
|
require_relative "suno/resources/regenerate_validation_phrase"
|
|
30
31
|
require_relative "suno/resources/generate_voice"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runapi-suno
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RunAPI
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.6.
|
|
18
|
+
version: 0.6.1
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.6.
|
|
25
|
+
version: 0.6.1
|
|
26
26
|
description: The Suno Ruby SDK is the language-specific package for Suno on RunAPI.
|
|
27
27
|
Use this package for song generation, lyrics, vocals, extension, and audio transformation
|
|
28
28
|
workflows when your application needs request bodies, task status lookup, and consistent
|
|
@@ -69,6 +69,7 @@ files:
|
|
|
69
69
|
- lib/runapi/suno/resources/style_expansions.rb
|
|
70
70
|
- lib/runapi/suno/resources/text_to_music.rb
|
|
71
71
|
- lib/runapi/suno/resources/text_to_sound.rb
|
|
72
|
+
- lib/runapi/suno/resources/text_to_speech.rb
|
|
72
73
|
- lib/runapi/suno/resources/timestamped_lyrics.rb
|
|
73
74
|
- lib/runapi/suno/resources/visualize_music.rb
|
|
74
75
|
- lib/runapi/suno/resources/voice_to_validation_phrase.rb
|