SuperAPI AI Directory

bark

A transformer-based text-to-audio model. #opensource

Open website

About this tool

Purpose

Bark is an open-source text-to-audio model created by Suno, based on the Transformer architecture. It is not a traditional TTS model, but a fully generative text-to-audio model; input text prompts can be directly converted to audio without intermediate phoneme steps, so it can generalize to arbitrary instructions such as music lyrics, sound effects, or other non-speech sounds. The model is intended for research and demonstration purposes, and outputs may deviate from the given prompt in unexpected ways.

Main Capabilities

  • Generate highly realistic multilingual speech.
  • Generate other audio, including music, background noise, and simple sound effects.
  • Produce non-verbal communication such as laughter, sighs, and crying.
  • Support 100+ speaker presets across supported languages. Presets attempt to match tone, pitch, emotion, and prosody, but custom voice cloning is not supported.
  • Support generation of unique random voices that match the input text.
  • The model also attempts to preserve music, ambient noise, and more.
  • Support control via special markers: such as [clears throat], — or ... for hesitation, ♪ for lyrics, uppercase for emphasis, and [MAN] and [WOMAN] to bias toward male and female speakers respectively.
  • The default generate_audio is suitable for about 13 seconds of read text; see the Notebook for long-text generation examples.

Usage

Python Usage

It can be called via Python. Note: do not use pip install bark, that command installs another package not managed by Suno.

🤗 Transformers Usage

Bark has been available in the 🤗 Transformers library since Transformers version 4.31.0, with minimal dependencies. Steps: first install the 🤗 Transformers library from main; then run the Python code to generate speech samples; you can listen to the audio in an ipynb notebook, or use a third-party library (such as scipy) to save it as a .wav file. For more inference details, refer to the Bark documentation or the hands-on Google Colab.

Hardware and Inference Speed

Bark has been tested and can run on CPU and GPU (pytorch 2.0+, CUDA 11.7, and CUDA 12.0). On enterprise-grade GPUs and PyTorch nightly, audio can be generated roughly in real time; on older GPUs, the default colab, or CPU, inference time may be noticeably slower, and you may consider using a smaller model. The full version of Bark requires about 12GB VRAM to keep everything on the GPU at once; if using a smaller version (which should fit in 8GB VRAM), set the environment flag SUNO_USE_SMALL_MODELS=True. Even with a graphics card as low as about 2GB, it can work through additional settings.

Acceleration and Low VRAM

There is 2x acceleration on GPU and 10x acceleration on CPU. A smaller version of Bark has also been added, trading slightly lower quality for additional acceleration. Bark can now be used on GPUs with low VRAM (<4GB).

Model Download and Storage

Bark uses Hugging Face to download and store models.

Use Cases

  • The research community obtains pretrained model checkpoints for inference.
  • Commercial use (MIT license).
  • Generate multilingual speech, music, background noise, simple sound effects, non-verbal communication, etc.
  • Examples such as long-form audio generation and voice consistency enhancement are documented in the notebooks section.
  • The community actively shares useful prompts in the #audio-prompts channel on Discord; a voice prompt library is also provided to help find suitable prompts.

Limitations

  • Bark was developed for research purposes and is not a traditional TTS; it may deviate from prompts in unexpected ways; Suno is not responsible for generated output, use at your own risk, and please use it responsibly.
  • Custom voice cloning is currently not supported.
  • Output quality is not guaranteed to be high-fidelity, studio-grade speech; output can range from perfect speech to noisy recordings of multiple people arguing.
  • The full version requires about 12GB of VRAM.
  • Inference speed depends on hardware; older GPUs or CPUs may be significantly slower.
  • Language is automatically detected; for example, using a German historical prompt with English text usually produces English audio with a German accent.

Examples of Non-Speech Sounds

The list of known non-speech sounds is continuously being discovered, including [clears throat]、— or ... indicates hesitation,♪ indicates lyrics, capitalization indicates emphasis,[MAN] and [WOMAN] favor gendered speakers.

License

Bark is now under the MIT license and can be used for commercial purposes.

Related Projects

  • nanoGPT: A minimal and fast implementation of GPT-style models.
  • EnCodec: An excellent state-of-the-art implementation of an audio codec.
  • AudioLM: Related training and inference code.
  • Groundbreaking papers such as Vall-E and AudioLM.