https://github.com/suno-ai/bark Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} suno-ai / bark Public * Notifications * Fork 70 * Star 1.2k Text-prompted Generative Audio Model License View license 1.2k stars 70 forks Star Notifications * Code * Issues 11 * Pull requests 3 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights suno-ai/bark This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/s] Use Git or checkout with SVN using the web URL. [gh repo clone suno-a] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @mcamac mcamac Update README.md ... 2a602ce Apr 20, 2023 Update README.md 2a602ce Git stats * 19 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time bark add new prompts April 17, 2023 15:59 notebooks add new prompts April 17, 2023 15:59 .gitignore remove pycache April 10, 2023 13:11 LICENSE first commit April 9, 2023 13:21 README.md Update README.md April 20, 2023 14:41 model-card.md add fake classifier April 12, 2023 14:31 pyproject.toml first commit April 9, 2023 13:21 setup.py first commit April 9, 2023 13:21 View code [ ] Bark Demos Usage Foreign Language Music Voice/Audio Cloning Speaker Prompts Installation [?] Hardware and Inference Speed [?][?] Details Appreciation (c) License Community Suno Studio (Early Access) README.md Bark [687474703a] Twitter [6874747073] Examples | Model Card | Playground Waitlist Bark is a transformer-based text-to-audio model created by Suno. Bark can generate highly realistic, multilingual speech as well as other audio - including music, background noise and simple sound effects. The model can also produce nonverbal communications like laughing, sighing and crying. To support the research community, we are providing access to pretrained model checkpoints ready for inference. [230698495-cbb1ced9-c911-4c9a-941d-a1a4a1286ac6] Demos Open in Spaces Open In Colab Usage from bark import SAMPLE_RATE, generate_audio from IPython.display import Audio text_prompt = """ Hello, my name is Suno. And, uh -- and I like pizza. [laughs] But I also have other interests such as playing tic tac toe. """ audio_array = generate_audio(text_prompt) Audio(audio_array, rate=SAMPLE_RATE) pizza.webm To save audio_array as a WAV file: from scipy.io.wavfile import write as write_wav write_wav("/path/to/audio.wav", SAMPLE_RATE, audio_array) Foreign Language Bark supports various languages out-of-the-box and automatically determines language from input text. When prompted with code-switched text, Bark will even attempt to employ the native accent for the respective languages in the same voice. text_prompt = """ Buenos dias Miguel. Tu colega piensa que tu aleman es extremadamente malo. But I suppose your english isn't terrible. """ audio_array = generate_audio(text_prompt) miguel.webm Music Bark can generate all types of audio, and, in principle, doesn't see a difference between speech and music. Sometimes Bark chooses to generate text as music, but you can help it out by adding music notes around your lyrics. text_prompt = """ In the jungle, the mighty jungle, the lion barks tonight """ audio_array = generate_audio(text_prompt) lion.webm Voice/Audio Cloning Bark has the capability to fully clone voices - including tone, pitch, emotion and prosody. The model also attempts to preserve music, ambient noise, etc. from input audio. However, to mitigate misuse of this technology, we limit the audio history prompts to a limited set of Suno-provided, fully synthetic options to choose from for each language. Specify following the pattern: {lang_code} _speaker_{number}. text_prompt = """ I have a silky smooth voice, and today I will tell you about the exercise regimen of the common sloth. """ audio_array = generate_audio(text_prompt, history_prompt="en_speaker_1") sloth.webm Note: since Bark recognizes languages automatically from input text, it is possible to use for example a german history prompt with english text. This usually leads to english audio with a german accent. Speaker Prompts You can provide certain speaker prompts such as NARRATOR, MAN, WOMAN, etc. Please note that these are not always respected, especially if a conflicting audio history prompt is given. text_prompt = """ WOMAN: I would like an oatmilk latte please. MAN: Wow, that's expensive! """ audio_array = generate_audio(text_prompt) latte.webm Installation pip install git+https://github.com/suno-ai/bark.git or git clone https://github.com/suno-ai/bark cd bark && pip install . [?] Hardware and Inference Speed Bark has been tested and works on both CPU and GPU (pytorch 2.0+, CUDA 11.7 and CUDA 12.0). Running Bark requires running >100M parameter transformer models. On modern GPUs and PyTorch nightly, Bark can generate audio in roughly realtime. On older GPUs, default colab, or CPU, inference time might be 10-100x slower. If you don't have new hardware available or if you want to play with bigger versions of our models, you can also sign up for early access to our model playground here. [?][?] Details Similar to Vall-E and some other amazing work in the field, Bark uses GPT-style models to generate audio from scratch. Different from Vall-E, the initial text prompt is embedded into high-level semantic tokens without the use of phonemes. It can therefore generalize to arbitrary instructions beyond speech that occur in the training data, such as music lyrics, sound effects or other non-speech sounds. A subsequent second model is used to convert the generated semantic tokens into audio codec tokens to generate the full waveform. To enable the community to use Bark via public code we used the fantastic EnCodec codec from Facebook to act as an audio representation. Below is a list of some known non-speech sounds, but we are finding more every day. Please let us know if you find patterns that work particularly well on Discord! * [laughter] * [laughs] * [sighs] * [music] * [gasps] * [clears throat] * -- or ... for hesitations * for song lyrics * capitalization for emphasis of a word * MAN/WOMAN: for bias towards speaker Supported Languages Language Status English (en) German (de) Spanish (es) French (fr) Hindi (hi) Italian (it) Japanese (ja) Korean (ko) Polish (pl) Portuguese (pt) Russian (ru) Turkish (tr) Chinese, simplified (zh) Arabic Coming soon! Bengali Coming soon! Telugu Coming soon! Appreciation * nanoGPT for a dead-simple and blazing fast implementation of GPT-style models * EnCodec for a state-of-the-art implementation of a fantastic audio codec * AudioLM for very related training and inference code * Vall-E, AudioLM and many other ground-breaking papers that enabled the development of Bark (c) License Bark is licensed under a non-commercial license: CC-BY 4.0 NC. The Suno models themselves may be used commercially. However, this version of Bark uses EnCodec as a neural codec backend, which is licensed under a non-commercial license. Please contact us at bark@suno.ai if you need access to a larger version of the model and/or a version of the model you can use commercially. Community * Twitter * Discord Suno Studio (Early Access) We're developing a playground for our models, including Bark. If you are interested, you can sign up for early access here. About Text-prompted Generative Audio Model Resources Readme License View license Stars 1.2k stars Watchers 37 watching Forks 70 forks Report repository Contributors 4 * @gkucsko gkucsko Georg Kucsko * @kmfreyberg kmfreyberg Keenan Freyberg * @mcamac mcamac Martin Camacho * @mikeyshulman mikeyshulman Languages * Python 53.0% * Jupyter Notebook 47.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.