Rename to piper

This commit is contained in:
Michael Hansen
2023-03-26 21:42:04 -05:00
parent 3dfa161ba5
commit 70afec58bc
62 changed files with 348 additions and 207 deletions

View File

@@ -15,7 +15,7 @@ _PAD = "_"
@dataclass
class LarynxConfig:
class PiperConfig:
num_symbols: int
num_speakers: int
sample_rate: int
@@ -26,7 +26,7 @@ class LarynxConfig:
phoneme_id_map: Mapping[str, Sequence[int]]
class Larynx:
class Piper:
def __init__(
self,
model_path: Union[str, Path],
@@ -114,12 +114,12 @@ class Larynx:
return wav_io.getvalue()
def load_config(config_path: Union[str, Path]) -> LarynxConfig:
def load_config(config_path: Union[str, Path]) -> PiperConfig:
with open(config_path, "r", encoding="utf-8") as config_file:
config_dict = json.load(config_file)
inference = config_dict.get("inference", {})
return LarynxConfig(
return PiperConfig(
num_symbols=config_dict["num_symbols"],
num_speakers=config_dict["num_speakers"],
sample_rate=config_dict["audio"]["sample_rate"],

View File

@@ -5,7 +5,7 @@ import time
from functools import partial
from pathlib import Path
from . import Larynx
from . import Piper
_FILE = Path(__file__)
_DIR = _FILE.parent
@@ -34,7 +34,7 @@ def main() -> None:
args = parser.parse_args()
logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)
voice = Larynx(args.model, config_path=args.config, use_cuda=args.cuda)
voice = Piper(args.model, config_path=args.config, use_cuda=args.cuda)
synthesize = partial(
voice.synthesize,
speaker_id=args.speaker,

View File

@@ -17,7 +17,7 @@ if [ -d "${venv}" ]; then
source "${venv}/bin/activate"
fi
python_files=("${base_dir}/larynx")
python_files=("${base_dir}/piper")
# Format code
black "${python_files[@]}"

View File

@@ -14,4 +14,4 @@ if [ -d "${venv}" ]; then
source "${venv}/bin/activate"
fi
python3 -m larynx "$@"
python3 -m piper "$@"