mirror of
https://github.com/pstrueb/piper.git
synced 2026-04-24 00:34:50 +00:00
Rename to piper
This commit is contained in:
@@ -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"],
|
||||
@@ -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,
|
||||
@@ -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[@]}"
|
||||
|
||||
@@ -14,4 +14,4 @@ if [ -d "${venv}" ]; then
|
||||
source "${venv}/bin/activate"
|
||||
fi
|
||||
|
||||
python3 -m larynx "$@"
|
||||
python3 -m piper "$@"
|
||||
Reference in New Issue
Block a user