Supertonic 3 Supported Languages and Language Codes: Complete Guide
Supertonic 3 supports 31 individual languages plus a language-agnostic mode using ISO-639-1 two-letter codes passed via the lang parameter across all official bindings.
The supertone-inc/supertonic repository provides a multilingual Text-to-Speech (TTS) engine capable of synthesizing speech from text in 31 distinct languages. Understanding how to specify language codes correctly is essential for optimal voice generation across the various language bindings including Python, JavaScript, Rust, Go, C++, Swift, and C#.
Supported Languages in Supertonic 3
Supertonic 3 synthesizes speech using ISO-639-1 two-letter codes to identify target languages. The system supports 31 individual languages plus a special language-agnostic mode that lets the model infer the language automatically.
The complete list of supported language codes includes:
| Code | Language |
|---|---|
en |
English |
ko |
Korean |
ja |
Japanese |
ar |
Arabic |
bg |
Bulgarian |
cs |
Czech |
da |
Danish |
de |
German |
el |
Greek |
es |
Spanish |
et |
Estonian |
fi |
Finnish |
fr |
French |
hi |
Hindi |
hr |
Croatian |
hu |
Hungarian |
id |
Indonesian |
it |
Italian |
lt |
Lithuanian |
lv |
Latvian |
nl |
Dutch |
pl |
Polish |
pt |
Portuguese |
ro |
Romanian |
ru |
Russian |
sk |
Slovak |
sl |
Slovenian |
sv |
Swedish |
tr |
Turkish |
uk |
Ukrainian |
vi |
Vietnamese |
na |
Language-agnostic |
Use the special na code when you want Supertonic to automatically detect and infer the language from the input text.
Where Language Codes Are Defined in the Source
According to the Supertonic source code, each language binding maintains an identical canonical list of available languages in helper validation files. These constants ensure consistent behavior across platforms:
- JavaScript/Web:
web/helper.jsexportsAVAILABLE_LANGSas an array of strings - Python:
py/helper.pydefinesAVAILABLE_LANGSas a list constant - Rust:
rust/src/helper.rsdeclarespub const AVAILABLE_LANGS: &[&str] - Swift:
swift/Sources/Helper.swiftcontainslet AVAILABLE_LANGS - Go:
go/helper.gospecifiesconst AVAILABLE_LANGS - C++:
cpp/helper.cppusesconst std::vector<std::string> AVAILABLE_LANGS - C#:
csharp/Helper.csreferencesLanguages.Available
If an unsupported code is supplied, these helpers throw language-specific errors indicating the valid set.
How to Specify Language Codes in Each Binding
Each binding exposes a parameter—commonly named lang, --lang, or language—that accepts one of the ISO-639-1 codes above.
JavaScript and Web
In web/helper.js, pass the language code via the lang property:
import { synthesize } from "./helper.js";
const wav = await synthesize({
text: "Hello, world!",
voice: "en_female_1",
lang: "en",
nfe: 5,
});
The helper validates that "en" exists in AVAILABLE_LANGS before processing.
Python
The Python binding in py/helper.py uses a lang parameter and raises ValueError for invalid codes:
from supertonic.helper import synthesize
wav = synthesize(
text="Bonjour le monde!",
voice="fr_male_2",
lang="fr",
nfe=5,
)
Rust CLI
For the Rust command-line interface defined in rust/src/helper.rs, use the --lang flag:
supertonic-cli \
--text "こんにちは世界" \
--voice ja_female_1 \
--lang ja \
--nfe 5 \
--output hello.wav
The binary aborts with a clear error if the code is not found in AVAILABLE_LANGS.
Go
In go/helper.go, specify the language via the Lang field:
wav, err := helper.Synthesize(helper.Params{
Text: "Привет мир",
Voice: "ru_male_1",
Lang: "ru",
NFE: 5,
})
Invalid codes trigger a panic listing available languages.
C++
The C++ implementation in cpp/helper.cpp validates codes against AVAILABLE_LANGS and throws std::runtime_error on mismatch:
auto wav = synthesize(
"Hallo Welt",
"de_female_1",
"de",
5
);
Swift
For iOS development using swift/Sources/Helper.swift, use the language parameter:
let wav = try Helper.synthesize(
text: "안녕하세요",
voice: "ko_female_1",
language: "ko",
nfe: 5
)
An invalid code results in a fatalError displaying the full valid list.
C#
In the C# binding (csharp/Helper.cs), pass the code via the lang parameter:
var wav = Helper.Synthesize(
text: "Ciao mondo",
voice: "it_male_1",
lang: "it",
nfe: 5);
Helper.cs validates against Languages.Available and throws ArgumentException for unsupported codes.
Summary
- Supertonic 3 supports 31 languages using ISO-639-1 two-letter codes plus a language-agnostic mode (
na) - Language validation is enforced consistently across all bindings via
AVAILABLE_LANGSconstants in helper files - Specify codes using the
lang,--lang, orlanguageparameter depending on your binding - Invalid codes trigger immediate errors with helpful messages listing supported options
- Use
na(language-agnostic) when you want Supertonic to infer the language automatically
Frequently Asked Questions
What happens if I use an unsupported language code in Supertonic 3?
Each binding validates input against the AVAILABLE_LANGS constant. If you provide an unsupported code, the library throws a language-specific error: ValueError in Python, std::runtime_error in C++, ArgumentException in C#, or a panic in Go and Rust. All error messages include the complete list of valid codes.
Can I use Supertonic 3 without specifying a language?
Yes. Pass the special code na (language-agnostic) to let Supertonic automatically infer the language from your input text. This is useful when processing multilingual content or when the source language is unknown.
Are language codes case-sensitive in Supertonic 3?
The source code stores language codes as lowercase strings in all AVAILABLE_LANGS arrays. While some bindings may normalize input, you should use lowercase ISO-639-1 codes (e.g., "en" not "EN") to ensure compatibility across all platforms.
How do I check if my language is supported programmatically?
Access the public AVAILABLE_LANGS constant exposed in each binding's helper file. For example, in Python import AVAILABLE_LANGS from supertonic.helper, or in JavaScript import { AVAILABLE_LANGS } from ./helper.js. Check if your desired code exists in this array before calling synthesize.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →