Example Python File
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 = """ ♪ Hello, welcome to LinuxLinks. [laughs] We hope you love our content. ♪ """ audio_array = generate_audio(text_prompt) # save audio to disk write_wav("bark-LinuxLinks.wav", SAMPLE_RATE, audio_array) # play text in notebook Audio(audio_array, rate=SAMPLE_RATE)
Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary
Page 3 – Example Python File
Never heard of Bark before. It looks kinda interesting. I’ll give it a whirl under Ubuntu.
I’m using Debian so I should be able to get it working.
do what?
Can you run Bark without a dedicated graphics card? I’ve got a 5th generation Intel machine with 8GB of RAM.
We don’t recommend using Bark without a dedicated GPU, but it’s definitely possible to run it without one.
You’ll get a warning
“No GPU being used. Careful, inference might be very slow!”
And that’s definitely the case. A 5 second clip took over a minute to be generated on an Intel i5-10400 machine.
Even with an i9-13900K, processing is slow. A dedicated graphics card is a must for these machine learning apps.