Skip to content

Commit

Permalink
Pythonコードをリファクタ (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip authored May 20, 2023
1 parent babce87 commit 406f6c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from . import _load_dlls # noqa: F401

from ._models import ( # noqa: F401
AccelerationMode,
AccentPhrase,
Expand All @@ -10,7 +9,6 @@
)
from ._rust import METAS, SUPPORTED_DEVICES, VoicevoxCore # noqa: F401


__all__ = [
"METAS",
"SUPPORTED_DEVICES",
Expand Down
4 changes: 2 additions & 2 deletions example/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ run.py を実行します。 Open JTalk 辞書ディレクトリ、読み上げ

```console
python ./run.py -h
usage: run.py [-h] [--mode MODE] [--dict-dir DICT_DIR] [--text TEXT] [--out OUT] [--speeker-id SPEEKER_ID]
usage: run.py [-h] [--mode MODE] [--dict-dir DICT_DIR] [--text TEXT] [--out OUT] [--speaker-id SPEAKER_ID]

optional arguments:
-h, --help show this help message and exit
--mode MODE モード ("AUTO", "CPU", "GPU")
--dict-dir DICT_DIR Open JTalkの辞書ディレクトリ
--text TEXT 読み上げさせたい文章
--out OUT 出力wavファイルのパス
--speeker-id SPEEKER_ID
--speaker-id SPEAKER_ID
話者IDを指定
```

Expand Down
6 changes: 2 additions & 4 deletions example/python/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import voicevox_core
from voicevox_core import AccelerationMode, AudioQuery, VoicevoxCore

SPEAKER_ID = 0


def main() -> None:
logging.basicConfig(format="[%(levelname)s] %(name)s: %(message)s")
Expand Down Expand Up @@ -71,13 +69,13 @@ def parse_args() -> Tuple[AccelerationMode, Path, str, Path, int]:
help="出力wavファイルのパス",
)
argparser.add_argument(
"--speeker-id",
"--speaker-id",
default=0,
type=int,
help="話者IDを指定",
)
args = argparser.parse_args()
return (args.mode, args.dict_dir, args.text, args.out, args.speeker_id)
return (args.mode, args.dict_dir, args.text, args.out, args.speaker_id)


def display_as_json(audio_query: AudioQuery) -> str:
Expand Down

0 comments on commit 406f6c4

Please sign in to comment.