File size: 526 Bytes
e001d2e 496e159 e001d2e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from bark import SAMPLE_RATE, generate_audio, preload_models
from scipy.io.wavfile import write as write_wav
from IPython.display import Audio
# download and load all models
preload_models()
# generate audio from text
text_prompt = """
Le meilleur pilotes de tout les temps ?
j'hésite ... Hamilton ? oui, je dirais Hamilton.
"""
audio_array = generate_audio(text_prompt)
# save audio to disk
write_wav("bark_generation.wav", SAMPLE_RATE, audio_array)
# play text in notebook
Audio(audio_array, rate=SAMPLE_RATE) |