我想将Elevenlab生成的音频文件保存到一个文件夹中,但我不确定库中是否有保存或导出功能。我尝试使用pydub,因为我在elevenlabslib中找不到导出函数。
from elevenlabslib import *
from pydub import AudioSegment
user = ElevenLabsUser("Blalalal")
voice = user.get_voices_by_name("Elli")[0]
savelocation = "C:\Users\BattleShip\Desktop\work\Voices"
voice.generate_and_play_audio("This is a Test. This means it is working.", playInBackground=False)
audio = AudioSegment.from_file(voice) #this is probably the problem where voice isn't a wav or mp3
audio.export(savelocation, format="wav")
我只想自动将音频文件保存到savelocation文件夹中。
1条答案
按热度按时间zzwlnbp81#
格式:
来源:https://github.com/elevenlabs/elevenlabs-python/blob/main/API.md