Skip to content

Commit

Permalink
harmonize python demo arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
bejager committed May 8, 2024
1 parent e8b3c03 commit aa55260
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
run: >
python3 orca_demo_streaming.py
--access_key ${{secrets.PV_VALID_ACCESS_KEY}}
--text "Hello, I am Orca!"
--text_to_stream "Hello, I am Orca!"
- name: Test single
run: >
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
run: >
python3 orca_demo_streaming.py
--access_key ${{secrets.PV_VALID_ACCESS_KEY}}
--text "Hello, I am Orca!"
--text_to_stream "Hello, I am Orca!"
- name: Test single
run: >
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ This enables seamless conversations with voice assistants, eliminating any audio

![](https://github.com/Picovoice/orca/blob/orca-prepare-v0.2/resources/assets/orca_streaming_animation.gif)

As demonstrated above, Orca starts converting text to audio right away, while other TTS systems, such as OpenAI TTS,
need to wait for the entire LLM output to be available, introducing a delay in the voice assistant's response.

Orca also supports single synthesis mode, where a complete text is synthesized in a single call to the Orca engine.

### Text input
Expand Down Expand Up @@ -133,23 +130,29 @@ AccessKey also verifies that your usage is within the limits of your account. Ev

### Python Demos

To run the Python demo, run the following in the console:
Install the demo package:

```console
pip3 install pvorcademo
```

Run the streaming demo:

```console
orca_demo_streaming --access_key ${ACCESS_KEY} --text-to-stream ${TEXT}
orca_demo_streaming --access_key ${ACCESS_KEY} --text_to_stream ${TEXT}
```

Run the single synthesis demo:

```console
orca_demo --access_key ${ACCESS_KEY} --text ${TEXT} --output_path ${WAV_OUTPUT_PATH}
```

Replace `${ACCESS_KEY}` with yours obtained from Picovoice Console, `${TEXT}` with the text to be synthesized, and
`${WAV_OUTPUT_PATH}` with a path to an output WAV file.

For more information about Python demos go to [demo/python](demo/python).

### iOS Demo

Run the following from [demo/ios](demo/ios) to install the Orca-iOS CocoaPod:
Expand Down
2 changes: 1 addition & 1 deletion demo/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ We stream that text to Orca and play the synthesized audio as soon as it gets ge
To run it, execute the following:

```console
orca_demo_streaming --access_key ${ACCESS_KEY} --text-to-stream ${TEXT}
orca_demo_streaming --access_key ${ACCESS_KEY} --text_to_stream ${TEXT}
```

Replace `${ACCESS_KEY}` with your `AccessKey` obtained from Picovoice Console and `${TEXT}` with your text to be
Expand Down
8 changes: 4 additions & 4 deletions demo/python/orca_demo_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,22 +300,22 @@ def main() -> None:
"-m",
help="Absolute path to Orca model. Default: using the model provided by `pvorca`")
parser.add_argument(
"--text-to-stream",
"--text_to_stream",
"-t",
required=True,
help="Text to be streamed to Orca")
parser.add_argument(
"--tokens-per-second",
"--tokens_per_second",
type=int,
default=15,
help="Number of tokens per second to be streamed to Orca, simulating an LLM response.")
parser.add_argument(
"--audio-wait-chunks",
"--audio_wait_chunks",
type=int,
default=None,
help="Number of PCM chunks to wait before starting to play audio. Default: system-dependent.")
parser.add_argument(
"--show-audio-devices",
"--show_audio_devices",
action="store_true",
help="Only list available audio output devices and exit")
parser.add_argument('--audio-device-index', type=int, default=None, help='Index of input audio device')
Expand Down

0 comments on commit aa55260

Please sign in to comment.