feat: implement shorter args
This commit is contained in:
parent
364eaf0610
commit
12a4948425
2 changed files with 14 additions and 1 deletions
|
@ -84,6 +84,9 @@ To run the program with an input file, use flag `--input_file`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ python tts.py --input_file demo/tongue-twister.txt
|
$ python tts.py --input_file demo/tongue-twister.txt
|
||||||
|
|
||||||
|
# or shorter...
|
||||||
|
$ python tts.py -i demo/tongue-twister.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### Voices
|
### Voices
|
||||||
|
@ -92,6 +95,9 @@ Optionally, you can indicate a voice you want to use with the `--voice` flag. Se
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ python tts.py --voice am_michael
|
$ python tts.py --voice am_michael
|
||||||
|
|
||||||
|
# or shorter...
|
||||||
|
$ python tts.py -v am_michael
|
||||||
```
|
```
|
||||||
|
|
||||||
There are four shortcuts available to the best voices: `pro`, `hot`, `asmr`, `brit` (i.e., best trained voices), and `pro` is the default if no value is given
|
There are four shortcuts available to the best voices: `pro`, `hot`, `asmr`, `brit` (i.e., best trained voices), and `pro` is the default if no value is given
|
||||||
|
@ -113,6 +119,9 @@ You can disable the built-in audio player with `--skip_play` if you choose to pl
|
||||||
```bash
|
```bash
|
||||||
$ python tts.py "Hello there!" --voice asmr --skip_play
|
$ python tts.py "Hello there!" --voice asmr --skip_play
|
||||||
|
|
||||||
|
# or shorter...
|
||||||
|
$ python tts.py "Hello there!" --voice asmr -s
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Demo Outputs
|
## Demo Outputs
|
||||||
|
|
6
tts.py
6
tts.py
|
@ -21,7 +21,7 @@ voices = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser(description="Simple TTS")
|
parser = argparse.ArgumentParser(description="Simple TTS", allow_abbrev=False)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"input_text",
|
"input_text",
|
||||||
type=str,
|
type=str,
|
||||||
|
@ -31,6 +31,7 @@ def parse_args():
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--voice",
|
"--voice",
|
||||||
|
"-v",
|
||||||
required=False,
|
required=False,
|
||||||
type=str,
|
type=str,
|
||||||
default="pro",
|
default="pro",
|
||||||
|
@ -38,6 +39,7 @@ def parse_args():
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--input_file",
|
"--input_file",
|
||||||
|
"-i",
|
||||||
required=False,
|
required=False,
|
||||||
type=str,
|
type=str,
|
||||||
default="demo/tongue-twister.txt",
|
default="demo/tongue-twister.txt",
|
||||||
|
@ -45,6 +47,7 @@ def parse_args():
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--device",
|
"--device",
|
||||||
|
"-d",
|
||||||
required=False,
|
required=False,
|
||||||
type=str,
|
type=str,
|
||||||
default=("cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else ("xpu" if torch.xpu.is_available() else "cpu"))),
|
default=("cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else ("xpu" if torch.xpu.is_available() else "cpu"))),
|
||||||
|
@ -52,6 +55,7 @@ def parse_args():
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--skip_play",
|
"--skip_play",
|
||||||
|
"-s",
|
||||||
required=False,
|
required=False,
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Prevent playing the generated audio",
|
help="Prevent playing the generated audio",
|
||||||
|
|
Loading…
Reference in a new issue