Closed mylegitches closed 5 months ago
Hello,
There is no built-in method in the SunoAI library to download a .wav file. However, you can use the pydub library to convert a downloaded .mp3 file to .wav format.
Here's an example code snippet:
import suno
from pydub import AudioSegment
client = suno.Suno(cookie='YOUR_COOKIE_HERE')
songs = client.generate(prompt="A serene landscape", is_custom=False, wait_audio=True)
for song in songs:
file_path = client.download(song=song)
print(f"Song downloaded to: {file_path}")
sound = AudioSegment.from_mp3(file_path)
sound.export("./file.wav", format="wav")
print("Converted to Wav Format!")
Can I use the download method to get the .wav files instead of mp3?