Spaces:
Sleeping
Sleeping
File size: 349 Bytes
a8467fc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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
|