Skip to content

Guide · Open source

How to use Bark: install, generate audio and voice presets

Updated · written with AI from the project's own documentation and checked against our catalogue data

Bark is an open-source, transformer-based text-to-audio model from Suno that turns written text into speech, music, background noise and simple sound effects. This guide is for developers, researchers and creators who want to run it locally with Python. By the end you will know how to install it, generate and save a clip, choose a voice preset, and understand its limits.

Barksuno-ai/bark · ★ 39.3k · MIT

Quick start

  1. 1Check prerequisites. Confirm you have Python, pip and Git installed before you start.
  2. 2Install from GitHub. Run pip install git+https://github.com/suno-ai/bark.git. Do not use plain pip install bark.
  3. 3Load the models. In Python, import generate_audio, preload_models and SAMPLE_RATE from bark, then call preload_models().
  4. 4Generate audio. Pass your text prompt to generate_audio(). Keep each prompt to around 13 seconds of spoken text.
  5. 5Save the result. Write the returned array to a WAV file with scipy's write function and the SAMPLE_RATE value.
  6. 6Try a voice preset. Pass history_prompt with a preset such as v2/en_speaker_1 to shape the tone of the voice.

What Bark can and cannot do

Bark can generate multilingual speech as well as music, background noise, simple sound effects and nonverbal sounds such as laughing, sighing and crying. The README describes it as a fully generative model rather than a conventional text-to-speech system, so it can deviate from your prompt in unexpected ways.

The README says custom voice cloning is not currently supported, and English quality is currently the best of the supported languages. Bark was developed for research purposes, and Suno does not take responsibility for generated output.

  • Good fit: Python developers adding speech or sound generation, researchers, and creators who accept unpredictable results.
  • Poor fit: precise, predictable narration; custom voice cloning; top quality in every language; a no-code app.

Install Bark from GitHub with pip

You need Python, pip and Git. The README recommends installing from GitHub and warns not to run plain pip install bark, because that installs a different package that is not managed by Suno.

You can also clone the repository and install from the local folder if you prefer to work from a copy of the code.

  • Recommended: install directly from the GitHub repository.
  • Alternative: clone the repository, then install from the cloned folder.
  • Do not use pip install bark.
pip install git+https://github.com/suno-ai/bark.git git clone https://github.com/suno-ai/bark cd bark && pip install .

Generate your first audio clip in Python

The basic workflow has three parts: load the models, generate audio from a text prompt, and save the result. The README downloads and loads all models with preload_models(), then calls generate_audio() on your text.

generate_audio() works well with around 13 seconds of spoken text by default. For longer audio, the README points to a long-form generation notebook instead of a single call.

  • Import SAMPLE_RATE, generate_audio and preload_models from bark.
  • Call preload_models() once to download and load the models.
  • Pass your text to generate_audio() and write the array to a WAV file with scipy.
from bark import SAMPLE_RATE, generate_audio, preload_models from scipy.io.wavfile import write as write_wav preload_models() text_prompt = """ Hello, my name is Suno. And, uh — and I like pizza. [laughs] """ audio_array = generate_audio(text_prompt) write_wav("bark_generation.wav", SAMPLE_RATE, audio_array)

Use voice presets, music notes and nonverbal cues

Bark supports more than 100 speaker presets across its supported languages. Pass a preset name with the history_prompt argument. The README says Bark tries to match the tone, pitch, emotion and prosody of a preset, but it does not clone a voice you supply.

To nudge Bark toward singing, wrap lyrics in music note symbols. The README notes that Bark sometimes generates text as music on its own, so the notes help. Nonverbal cues such as [laughs] are written inline in the prompt.

  • Browse presets in the voice prompt library linked in the README, or in the bark/assets/prompts folder of the code.
  • Use ♪ around lyrics to encourage musical output.
  • For other languages, Bark detects the language from the input text automatically.
audio_array = generate_audio(text_prompt, history_prompt="v2/en_speaker_1")

Use the command line

Bark also runs from the terminal through its module entry point. The README gives a single example that writes a WAV file to the name you choose.

  • Set the text with --text.
  • Set the output file with --output_filename.
python -m bark --text "Hello, my name is Suno." --output_filename "example.wav"

Run Bark through Transformers instead

The README says Bark is available in the Hugging Face Transformers library from version 4.31.0 onwards. Install Transformers from its main branch, then load the AutoProcessor and BarkModel from the suno/bark checkpoint.

Transformers generation returns a tensor, so the README converts it to a NumPy array on the CPU before saving or playing it.

  • Install Transformers from GitHub main, as the README instructs.
  • Load AutoProcessor and BarkModel from suno/bark.
  • Pass a voice_preset such as v2/en_speaker_6 to the processor.
from transformers import AutoProcessor, BarkModel processor = AutoProcessor.from_pretrained("suno/bark") model = BarkModel.from_pretrained("suno/bark") voice_preset = "v2/en_speaker_6" inputs = processor("Hello, my dog is cute", voice_preset=voice_preset) audio_array = model.generate(**inputs) audio_array = audio_array.cpu().numpy().squeeze()

What people use it for

  • Adding text-to-speech or sound generation to a Python project
  • Studying generative audio models in research
  • Creating expressive voice clips where some variation is acceptable
  • Testing multilingual speech output
  • Generating audio locally on a machine with a GPU

Frequently asked questions

Is Bark free to use?

Bark is released under the MIT License. The README states that the pretrained checkpoints are available for commercial use under that licence. Check the repository's licence file for the exact terms.

How do I install Bark?

Run pip install git+https://github.com/suno-ai/bark.git, or clone the repository and run pip install . from the cloned folder. The README warns against plain pip install bark, which installs an unrelated package.

What do I need to run Bark?

The README lists Python, pip and Git as prerequisites. It also mentions a GPU for faster generation, and says Bark can run on GPUs with less than 4GB of VRAM.

Can Bark clone my voice?

No. The README states that Bark does not currently support custom voice cloning. It offers speaker presets that match tone, pitch and emotion instead.

Does Bark support languages other than English?

Yes, Bark supports various languages and detects the language from the input text. The README says English quality is best for now and other languages are expected to improve.

Why does Bark output sound different from my prompt?

The README describes Bark as a fully generative model that can deviate from prompts in unexpected ways. Generating several takes and using voice presets can help you find a result you like.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Bark suits Python developers, researchers and creators who want expressive, multilingual audio generated locally and can tolerate unpredictable results. If you need precise narration, custom voice cloning or a no-code app, the README points you toward other options, and projects such as Coqui TTS, Piper, Tortoise TTS and Mimic 3 are listed as comparable.

Install options & downloads