papayaga's picture
demo
a8467fc
raw
history blame
349 Bytes
from elevenlabs import generate, set_api_key, save
import os
API_KEY = os.getenv('ELEVENLABS_KEY')
set_api_key(API_KEY)
def get_audio(a_uid, text, voice_id):
audio = generate(
text=text,
voice=voice_id,
model='eleven_multilingual_v2'
)
file_name = f'./files/audio/{a_uid}.mp3'
save(audio, file_name)
return file_name