Class: RunApi::Suno::Client
- Inherits:
-
Core::Client
- Object
- Core::Client
- RunApi::Suno::Client
- Defined in:
- lib/runapi/suno/client.rb
Overview
Suno music platform client covering song generation, extension, covers, stems, MIDI, lyrics, mashups, sound effects, visualization, personas, and voice cloning.
Instance Attribute Summary collapse
-
#add_instrumental ⇒ Resources::AddInstrumental
readonly
Generates and adds an instrumental backing track to uploaded audio.
-
#add_vocals ⇒ Resources::AddVocals
readonly
Generates and adds vocals to an uploaded instrumental track.
-
#boost_style ⇒ Resources::BoostStyle
readonly
Generates style/genre tags from a text description (synchronous).
-
#check_voice ⇒ Resources::CheckVoice
readonly
Step 4 of voice cloning: checks whether a custom voice is ready (synchronous).
-
#convert_audio ⇒ Resources::ConvertAudio
readonly
Converts a generated track to WAV format.
-
#cover_audio ⇒ Resources::CoverAudio
readonly
Re-records vocals over an uploaded audio file with a new style or voice.
-
#create_mashup ⇒ Resources::CreateMashup
readonly
Blends two audio tracks into a single new composition.
-
#extend_music ⇒ Resources::ExtendMusic
readonly
Continues an existing track from a specified timestamp.
-
#generate_artwork ⇒ Resources::GenerateArtwork
readonly
Creates cover artwork for an existing music task.
-
#generate_lyrics ⇒ Resources::GenerateLyrics
readonly
Produces AI-generated lyrics from a text prompt.
-
#generate_midi ⇒ Resources::GenerateMidi
readonly
Extracts per-instrument MIDI note data from a generated track.
-
#generate_persona ⇒ Resources::GeneratePersona
readonly
Creates a reusable style or voice persona from a track’s vocals (synchronous).
-
#generate_voice ⇒ Resources::GenerateVoice
readonly
Step 3 of voice cloning: trains a custom voice.
-
#get_timestamped_lyrics ⇒ Resources::GetTimestampedLyrics
readonly
Retrieves word-level timing alignment for a track (synchronous).
-
#regenerate_validation_phrase ⇒ Resources::RegenerateValidationPhrase
readonly
Step 2 (optional) of voice cloning: requests a new phrase.
-
#replace_section ⇒ Resources::ReplaceSection
readonly
Re-generates a time range within an existing track.
-
#separate_audio_stems ⇒ Resources::SeparateAudioStems
readonly
Splits a track into individual instrument stems.
-
#text_to_music ⇒ Resources::TextToMusic
readonly
Generates songs from a text prompt with configurable vocal mode, style, and persona.
-
#text_to_sound ⇒ Resources::TextToSound
readonly
Generates sound effects from a text description.
-
#visualize_music ⇒ Resources::VisualizeMusic
readonly
Generates a music visualization video from an existing track.
-
#voice_to_validation_phrase ⇒ Resources::VoiceToValidationPhrase
readonly
Step 1 of voice cloning: extracts a validation phrase.
Instance Method Summary collapse
-
#initialize(api_key: nil, **options) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key: nil, **options) ⇒ Client
Returns a new instance of Client.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/runapi/suno/client.rb', line 58 def initialize(api_key: nil, **) super @text_to_music = Resources::TextToMusic.new(http) @extend_music = Resources::ExtendMusic.new(http) @generate_artwork = Resources::GenerateArtwork.new(http) @cover_audio = Resources::CoverAudio.new(http) @add_instrumental = Resources::AddInstrumental.new(http) @add_vocals = Resources::AddVocals.new(http) @separate_audio_stems = Resources::SeparateAudioStems.new(http) @generate_midi = Resources::GenerateMidi.new(http) @convert_audio = Resources::ConvertAudio.new(http) @visualize_music = Resources::VisualizeMusic.new(http) @generate_lyrics = Resources::GenerateLyrics.new(http) @get_timestamped_lyrics = Resources::GetTimestampedLyrics.new(http) @replace_section = Resources::ReplaceSection.new(http) @create_mashup = Resources::CreateMashup.new(http) @text_to_sound = Resources::TextToSound.new(http) @voice_to_validation_phrase = Resources::VoiceToValidationPhrase.new(http) @regenerate_validation_phrase = Resources::RegenerateValidationPhrase.new(http) @generate_voice = Resources::GenerateVoice.new(http) @check_voice = Resources::CheckVoice.new(http) @generate_persona = Resources::GeneratePersona.new(http) @boost_style = Resources::BoostStyle.new(http) end |
Instance Attribute Details
#add_instrumental ⇒ Resources::AddInstrumental (readonly)
Returns generates and adds an instrumental backing track to uploaded audio.
24 25 26 |
# File 'lib/runapi/suno/client.rb', line 24 def add_instrumental @add_instrumental end |
#add_vocals ⇒ Resources::AddVocals (readonly)
Returns generates and adds vocals to an uploaded instrumental track.
26 27 28 |
# File 'lib/runapi/suno/client.rb', line 26 def add_vocals @add_vocals end |
#boost_style ⇒ Resources::BoostStyle (readonly)
Returns generates style/genre tags from a text description (synchronous).
56 57 58 |
# File 'lib/runapi/suno/client.rb', line 56 def boost_style @boost_style end |
#check_voice ⇒ Resources::CheckVoice (readonly)
Returns step 4 of voice cloning: checks whether a custom voice is ready (synchronous).
52 53 54 |
# File 'lib/runapi/suno/client.rb', line 52 def check_voice @check_voice end |
#convert_audio ⇒ Resources::ConvertAudio (readonly)
Returns converts a generated track to WAV format.
32 33 34 |
# File 'lib/runapi/suno/client.rb', line 32 def convert_audio @convert_audio end |
#cover_audio ⇒ Resources::CoverAudio (readonly)
Returns re-records vocals over an uploaded audio file with a new style or voice.
22 23 24 |
# File 'lib/runapi/suno/client.rb', line 22 def cover_audio @cover_audio end |
#create_mashup ⇒ Resources::CreateMashup (readonly)
Returns blends two audio tracks into a single new composition.
42 43 44 |
# File 'lib/runapi/suno/client.rb', line 42 def create_mashup @create_mashup end |
#extend_music ⇒ Resources::ExtendMusic (readonly)
Returns continues an existing track from a specified timestamp.
18 19 20 |
# File 'lib/runapi/suno/client.rb', line 18 def extend_music @extend_music end |
#generate_artwork ⇒ Resources::GenerateArtwork (readonly)
Returns creates cover artwork for an existing music task.
20 21 22 |
# File 'lib/runapi/suno/client.rb', line 20 def generate_artwork @generate_artwork end |
#generate_lyrics ⇒ Resources::GenerateLyrics (readonly)
Returns produces AI-generated lyrics from a text prompt.
36 37 38 |
# File 'lib/runapi/suno/client.rb', line 36 def generate_lyrics @generate_lyrics end |
#generate_midi ⇒ Resources::GenerateMidi (readonly)
Returns extracts per-instrument MIDI note data from a generated track.
30 31 32 |
# File 'lib/runapi/suno/client.rb', line 30 def generate_midi @generate_midi end |
#generate_persona ⇒ Resources::GeneratePersona (readonly)
Returns creates a reusable style or voice persona from a track’s vocals (synchronous).
54 55 56 |
# File 'lib/runapi/suno/client.rb', line 54 def generate_persona @generate_persona end |
#generate_voice ⇒ Resources::GenerateVoice (readonly)
Returns step 3 of voice cloning: trains a custom voice.
50 51 52 |
# File 'lib/runapi/suno/client.rb', line 50 def generate_voice @generate_voice end |
#get_timestamped_lyrics ⇒ Resources::GetTimestampedLyrics (readonly)
Returns retrieves word-level timing alignment for a track (synchronous).
38 39 40 |
# File 'lib/runapi/suno/client.rb', line 38 def @get_timestamped_lyrics end |
#regenerate_validation_phrase ⇒ Resources::RegenerateValidationPhrase (readonly)
Returns step 2 (optional) of voice cloning: requests a new phrase.
48 49 50 |
# File 'lib/runapi/suno/client.rb', line 48 def regenerate_validation_phrase @regenerate_validation_phrase end |
#replace_section ⇒ Resources::ReplaceSection (readonly)
Returns re-generates a time range within an existing track.
40 41 42 |
# File 'lib/runapi/suno/client.rb', line 40 def replace_section @replace_section end |
#separate_audio_stems ⇒ Resources::SeparateAudioStems (readonly)
Returns splits a track into individual instrument stems.
28 29 30 |
# File 'lib/runapi/suno/client.rb', line 28 def separate_audio_stems @separate_audio_stems end |
#text_to_music ⇒ Resources::TextToMusic (readonly)
Returns generates songs from a text prompt with configurable vocal mode, style, and persona.
16 17 18 |
# File 'lib/runapi/suno/client.rb', line 16 def text_to_music @text_to_music end |
#text_to_sound ⇒ Resources::TextToSound (readonly)
Returns generates sound effects from a text description.
44 45 46 |
# File 'lib/runapi/suno/client.rb', line 44 def text_to_sound @text_to_sound end |
#visualize_music ⇒ Resources::VisualizeMusic (readonly)
Returns generates a music visualization video from an existing track.
34 35 36 |
# File 'lib/runapi/suno/client.rb', line 34 def visualize_music @visualize_music end |
#voice_to_validation_phrase ⇒ Resources::VoiceToValidationPhrase (readonly)
Returns step 1 of voice cloning: extracts a validation phrase.
46 47 48 |
# File 'lib/runapi/suno/client.rb', line 46 def voice_to_validation_phrase @voice_to_validation_phrase end |