Welsh/English Bilingual Neural TTS (Bangor)
A bilingual Welsh (Cymraeg) + English neural text-to-speech voice (VITS / Piper architecture) with three professional studio voices. It pronounces English natively (not Welsh-accented) and handles code-switched cy/en text within a sentence, because it is phonemized with the Bangor Welsh G2P rather than eSpeak.
Developed by: Language Technologies Unit (Uned Technolegau Iaith), Bangor University.
Two models, two licences — choose what you need
This repo contains two models sharing the same three voices; only the warm-start base differs:
| File | Licence | Base | When to use |
|---|---|---|---|
cy_en_GB-bu_tts-bangor-medium.onnx (default) |
CC-BY-4.0 (attribution required) | VCTK (en_GB) | Best quality — recommended for most use |
cy_en_GB-bu_tts-bangor-cc0-medium.onnx |
CC0-1.0 (no attribution) | LJSpeech (public domain) | When you need a fully-free CC0 licence with no attribution obligation |
Both are fine-tuned on the same Welsh/English studio recordings; only the warm-start base differs. The default gives slightly better English; the -cc0- file is for users who must avoid any attribution requirement.
Model details
- Architecture: Piper VITS, medium quality
- Speakers: 3 (sid
0,1,2) - Sample rate: 22,050 Hz · Symbols: 256
- Phonemizer: Bangor Welsh G2P —
backend: bangor,english_mode: native,data_version: b1edc63e35bb7a6f - Punctuation-aware pauses; no eSpeak/GPL at inference.
⚠️ Important: phonemization
This model was trained with the Bangor G2P, so it will not pronounce correctly through the default eSpeak-based piper command. You must phonemize with the matching front-end:
- Python:
pip install techiaith-g2p—BangorG2P(english_mode="native"). Source: https://github.com/techiaith/techiaith-g2p · CC0-1.0 · no dependencies - C runtime: libcy_phonemize, in the same repository
Both emit the exact phoneme-id sequence the model expects; the runtime asserts data_version == b1edc63e35bb7a6f.
Usage (Python + ONNX Runtime + Bangor G2P)
pip install techiaith-g2p onnxruntime numpy
import numpy as np, onnxruntime as ort, wave
from techiaith.g2p import BangorG2P
g2p = BangorG2P(english_mode="native")
sess = ort.InferenceSession("cy_en_GB-bu_tts-bangor-medium.onnx") # or ...-cc0-medium.onnx
def synth(text, sid=0, path="out.wav", noise_w=0.8):
# For isolated letters / digits / very short "keyboard-echo" inputs, use noise_w≈0.3.
ids = g2p.text_to_ids(text)
scales = np.array([0.667, 1.0, noise_w], dtype=np.float32) # noise, length, noise_w
audio = sess.run(None, {
"input": np.array([ids], dtype=np.int64),
"input_lengths": np.array([len(ids)], dtype=np.int64),
"scales": scales,
"sid": np.array([sid], dtype=np.int64),
})[0].squeeze()
audio = (audio * (32767 / max(0.01, np.max(np.abs(audio))))).astype("<i2") # peak-normalize
with wave.open(path, "wb") as w:
w.setnchannels(1); w.setsampwidth(2); w.setframerate(22050); w.writeframes(audio.tobytes())
synth("Bore da. Sut wyt ti'n teimlo heddiw?", sid=0) # Welsh
synth("Good morning. How are you feeling today?", sid=1) # English
synth("Nes i fwcio'r tickets ar-lein, so we're all set.", 2) # code-switched
Model files
cy_en_GB-bu_tts-bangor-medium.onnx(+.onnx.json) — default model (CC-BY)cy_en_GB-bu_tts-bangor-cc0-medium.onnx(+.onnx.json) — CC0 variant
Intended use & limitations
Screen readers and assistive technology, Welsh/bilingual language-learning apps, and local/offline TTS. Best on general conversational Welsh, English, and mixed cy/en text. Medium quality (assistive-grade, not studio mastering); OOV/technical terms, rare place names and unusual spellings may mispronounce; neutral tone, limited emotional range.
Licence & attribution
This repo is licensed CC-BY-4.0, reflecting the default model (cy_en_GB-bu_tts-bangor-medium). The cy_en_GB-bu_tts-bangor-cc0-medium file is available under CC0-1.0 (public domain, no attribution).
The studio voices, integration code, scripts and Bangor G2P are in-house contributions of the Language Technologies Unit (CC0). The default model was warm-started from Piper's en_GB-vctk-medium voice, so it is a derivative work of:
CSTR VCTK Corpus (v0.92). Yamagishi, Junichi; Veaux, Christophe; MacDonald, Kirsten (2019). The Centre for Speech Technology Research (CSTR), University of Edinburgh. https://doi.org/10.7488/ds/2645 — under the Open Data Commons Attribution License (ODC-By) v1.0 / CC BY 4.0. Piper voices © Michael Hansen (rhasspy), CC BY 4.0.
The -cc0- variant was not warm-started from VCTK: it uses en_US-ljspeech-medium (public domain), so it carries no attribution requirement.