Closed sonodave closed 5 years ago
Oh yes, I ran into this too but forgot to mention it in the docs. The problem is in how the CLI parser interprets arguments that begin with a hyphen. The workaround is to use the alternate "equal sign" format for those arguments: tts test.txt test.mp3 --service gcp --project-file xxxx.json --language en-uS --type ssml --voice en-US-Wavenet-B --pitch=-2.0
(note the =
between the pitch name and value).
I might be able to tweak the code so that the equal-sign format is not necessary. At the very least I'll add a note to the docs to point that out.
More technical explanation:
The parser module follows POSIX conventions, so anything that begins with a hyphen is considered an option. So something like --pitch -2
is interpreted as 2 different options, pitch=true
and 2=true
(nevermind that seems nonsensical), rather than pitch=2
.
The generateSpeech Options seems to generate a null value if a negative value is used for the pitch parameter. example -2.0 Works fine with a positive value +2.0
tts test.txt test.mp3 --service gcp --project-file xxxx.json --language en-uS --type ssml --voice en-US-Wavenet-B --pitch -2.0
tts-cli called with arguments {"2":0,"_":["test.txt","test.mp3"],"service":"gcp","project-file":"xxxx.json","language":"en-uS","type":"ssml","voice":"en-US-Wavenet-B","pitch":true} +0ms
tts-cli called with arguments {"2":0,"_":["test.txt","test.mp3"],"service":"gcp","project-file":"xxxx.json","language":"en-uS","type":"ssml","voice":"en-US-Wavenet-B","pitch":true} +0ms
generateSpeech Options: {"ffmpeg":"ffmpeg","format":"mp3","language":"en-uS","limit":5,"pitch":null,"projectFile":"xxxx.json","region":"us-east-1","type":"ssml","voice":"en-US-Wavenet-B"} +0ms
generate Error during request: 3 INVALID_ARGUMENT: Synthesizer RPC generic::invalid_argument: Invalid (or unsupported) synthesis parameters +0ms generateAll Requested all parts, with error Error: 3 INVALID_ARGUMENT: Synthesizer RPC generic::invalid_argument: Invalid (or unsupported) synthesis parameters +0ms generate Error during request: 3 INVALID_ARGUMENT: Synthesizer RPC generic::invalid_argument: Invalid (or unsupported) synthesis parameters +0ms Error: 3 INVALID_ARGUMENT: Synthesizer RPC generic::invalid_argument: Invalid (or unsupported) synthesis parameters at Object.exports.createStatusError (C:\Users\ElJefe\AppData\Roaming\npm\node_modules\tts-cli\node_modules\grpc\src\common.js:87:15) at Object.onReceiveStatus (C:\Users\ElJefe\AppData\Roaming\npm\node_modules\tts-cli\node_modules\grpc\src\client_interceptors.js:1188:28) at InterceptingListener._callNext (C:\Users\ElJefe\AppData\Roaming\npm\node_modules\tts-cli\node_modules\grpc\src\client_interceptors.js:564:42) at InterceptingListener.onReceiveStatus (C:\Users\ElJefe\AppData\Roaming\npm\node_modules\tts-cli\node_modules\grpc\src\client_interceptors.js:614:8) at callback (C:\Users\ElJefe\AppData\Roaming\npm\node_modules\tts-cli\node_modules\grpc\src\client_interceptors.js:841:24)
If copyright allows, please upload your input file somewhere (e.g. pastebin) and put a link to it here.
What OS are you using (Windows, OSX, Linux) and what version?
What version of Node.js is being used? (Run
node -v
in the console to find out.)What version of ffmpeg is being used? (Run
ffmpeg -version
in the console to find out.)