File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
// If sox is available on the host system we use it to adjust pitch and rate
2
- // Otherwise, we pass the output unmodified to the PLAY_COMMAND, but adjust its
3
- // parameters based on whether it's likely to be aplay or paplay
2
+ // Otherwise, we pass the output unmodified to either paplay or aplay depending
3
+ // on what is available on the system.
4
4
const String modelTemplate = """
5
5
GenericExecuteSynth "if command -v sox > /dev/null; then\\
6
6
PROCESS=\\ 'sox -r SAMPLE_RATE -c 1 -b 16 -e signed-integer -t raw - -t wav - tempo \$ RATE pitch \$ PITCH norm\\ '; OUTPUT=\\ '\$ PLAY_COMMAND\\ ';\\
7
- elif [[ \\ '\$ PLAY_COMMAND\\ ' == aplay*]]; then\\
8
- PROCESS=\\ 'cat\\ '; OUTPUT=\\ '\$ PLAY_COMMAND -t raw -c 1 -r SAMPLE_RATE -f S16_LE\\ ';\\
9
- else\\
7
+ elif command -v paplay > /dev/null; then\\
10
8
PROCESS=\\ 'cat\\ '; OUTPUT=\\ '\$ PLAY_COMMAND --raw --channels 1 --rate SAMPLE_RATE\\ ';\\
9
+ else\\
10
+ PROCESS=\\ 'cat\\ '; OUTPUT=\\ 'aplay -t raw -c 1 -r SAMPLE_RATE -f S16_LE\\ ';\\
11
11
fi;\\
12
12
echo \\ '\$ DATA\\ ' | PIPER_PATH --model MODEL_PATH --output_raw | \$ PROCESS | \$ OUTPUT;"
13
13
GenericRateAdd 1
You can’t perform that action at this time.
0 commit comments