Skip to main content

Speech Articulatory Coding (SPARC)

Paper | Audio Samples | Colab Demo

drawing

This is the official code base for Coding Speech through Vocal Tract Kinematics.

Installation

git clone https://github.com/cheoljun95/Speech-Articulatory-Coding.git
cd Speech-Articulatory-Coding
pip install -e .

Usage

Load Model

from sparc import load_model
coder = load_model("en", device= "cpu")     # For using CPU
coder = load_model("en", device= "cuda:0")  # For using GPU

For pitch tracker, we found PENN is fast at inference. You can activate that with use_penn=True. The default is using torchcrepe.

coder = load_model("en", device= "cpu", use_penn=True)    # Use PENN for pitch tracker

For inversion only, you can use the following,

coder = load_model("feature_extraction") 
coder_from_config = load_model(config="configs/feature_extraction.yaml")

The following model checkpoints are offered. You can replace en with other models (multi or en+) in load_model.

Model Language Training Dataset
en English LibriTTS-R
multi Multi LibriTTS-R, Multilignual LibriSpeech, AISHELL, JVS, KSS
en+ English LibriTTS-R, LibriTTS, EXPRESSO

Articulatory Analysis

code = coder.encode(WAV_FILE)          # Single inference
codes = coder.encode([WAV_FILE1, WAV_FILE2, ...]) # Batched processing

The articulatory code outputs have the following format.

# All features are in 50 Hz except speaker encoding
{"ema": (L, 12) array, #'TDX','TDY','TBX','TBY','TTX','TTY','LIX','LIY','ULX','ULY','LLX','LLY'
 "loudness": (L, 1) array, 
 "pitch": (L, 1) array, 
 "periodicity": (L, 1) array, # auxiliary output of pitch tracker
 "pitch_stats": (pitch mean, pitch std),
 "spk_emb": (spk_emb_dim,) array, # all shared models use spk_emb_dim=64
 "ft_len": Length of features, # usefull when batched processing with padding
}

Articulatory Synthesis

wav = coder.decode(**code)
sr = coder.sr

Voice Conversion

wav = coder.convert(SOURCE_WAV_FILE, TARGET_WAV_FILE)
sr = coder.sr

Demo

Please check notebooks/demo.ipynb for a demonstration of the functions.

Training

Feature extraction

Check scripts/encode_audio.py and an example script for extracting LibriTTS, scripts/extract_libritts.sh

TODO

  • Add training codes.
  • Add pypi installation.

Metadata

Release files for speech-articulatory-coding 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speech-articulatory-coding 0.1.0
File Size Uploaded Provenance Actions
speech_articulatory_coding-0.1.0.tar.gz 15.3 kB Without provenance Details for speech_articulatory_coding-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for speech-articulatory-coding 0.1.0
File Interpreter ABI Platform Actions
speech_articulatory_coding-0.1.0-py3-none-any.whl Python 3 none any Details for speech_articulatory_coding-0.1.0-py3-none-any.whl

Total release size: 32.5 kB

Release files / speech_articulatory_coding-0.1.0.tar.gz

Download URL speech_articulatory_coding-0.1.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6a91ee0856b6fb73c3d6592dea1c3663cc1dd77786e54a0e83f71bdb23c8580d
BLAKE2b-256 checksum
How to use checksums
97ef3a6bbdb743dd5675540c3369bbc5956283a4ca471593924ef52d20b5dd66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.12

Release files / speech_articulatory_coding-0.1.0-py3-none-any.whl

Download URL speech_articulatory_coding-0.1.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c012bb629bce624994bef7d2ed0ef9c16709fe55fbf80f85909038b6880b05b
BLAKE2b-256 checksum
How to use checksums
5dab4cfca69c1f282a697a8d86c9c96556074dbcffc31d05e99894a5f02960f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.12

Security for speech-articulatory-coding 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page