Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT Add history prompts for custom voices #84

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
enum for bark languages
  • Loading branch information
PABannier committed Aug 17, 2023
commit 9af3ede09bc1a650bff135351ae71f430b4329e6
28 changes: 28 additions & 0 deletions bark.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/* Bark is a text-to-speech model for realistic speech generation.
The model supports 13 languages that can be found in `bark_languages`.
Multiple preset voices (history prompts) are shipped with Bark, allowing the user to
generate the same speech with multiple different voices.

You can try any combination of voices by using the following pattern:
<PREFIX><LANG>_speaker_<N>

where <PREFIX> can be either "" or "v2"
<LANG> can be the last two letters of any languages supported by bark
<N> is an integer between 0 and 9 (inclusive).
*/
#pragma once
#include "encodec.h"

Expand Down Expand Up @@ -27,6 +39,22 @@
#define COARSE_SEMANTIC_PAD_TOKEN 12048
#define COARSE_INFER_TOKEN 12050

enum bark_languages {
BARK_LANG_EN = 0, // English
BARK_LANG_DE = 1, // German
BARK_LANG_ES = 2, // Spanish
BARK_LANG_FR = 3, // French
BARK_LANG_HI = 4, // Hindi
BARK_LANG_IT = 5, // Italian
BARK_LANG_JA = 6, // Japanese
BARK_LANG_KO = 7, // Korean
BARK_LANG_PL = 8, // Polish
BARK_LANG_PT = 9, // Portuguese
BARK_LANG_RU = 10, // Russian
BARK_LANG_TR = 11, // Turkish
BARK_LANG_ZH = 12, // Chinese
};

struct bark_params {
int32_t n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency());

Expand Down