-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble executing nanotts via Node.js child_process.exec #8
Comments
I tried using Node.JS's
I also tried with an explicit input argument and quoted string:
|
Curiously, I can get it to work by commenting out the Lines 609 to 612 in e856ec3
... and using the syntax in my first
|
Hi, The program execution statements you posted work for me on the command-line. It would help me to know what you are trying to do. Are you trying to generate a WAV file, or playback? There are no web-friendly builtins at the moment. Nanotts does require you to specify which way you would like it to produce output. There isn't a default. Perhaps there should be. I don't remember precisely what my reasoning was for designing it this way. |
I'm sorry, reading closer, I see you are running node.js, not in a web browser. I'll try to repro this and get to the bottom of it. Citing lines 609-612 gets pretty close to the heart of it I think. You can safely leave those lines commented out in your copy to run in the mean-time. I'll post any findings here. Luckily, I'm fairly familiar with Node. :) |
Oh, one thing I see right off the bat is that if you do What will be sent to the command line will be The last phrase needs to be quoted. You could put an escape in like this: Also, the '"' after nanotts looks suspicious. Best....g |
Hey there :) Many thanks for the swift response!
Yes, however if I do quote the string I still get the "trailing commandline arguments" error, unless I comment out lines 609-612:
And if I make the input explicit with the
But I think you're on to something wrt quotes and escaping; I see in the error message that the command has been called with the "Hello world" string without the escaped space - I would have expected this to be "Hello\ world" instead. Perhaps Node.JS does something to "unescape" the string? Would this cause the "multiple inputs" error? Or has the escape character merely been dropped from the error message?
Ooops. That was just a typo in my posts - fixed now. |
I've looked at how @luisivan does it in his Node.JS wrapper for Seems no different to my code when it comes to quoting/escaping the message string. I also found this post on StackOverflow:
That would make a lot of sense, but doesn't explain why I'm having issues... |
In case you're wondering, this is what I'm working on: https://github.com/clickworkorange/node-red-contrib-nano-tts |
Still stuck on this - any help much appreciated!
|
Ok, I'm back. I got it to work by doing this. Give it a try. Ymmv, we'll see I guess.
Note: this writes a WAV, not playback. Changing to a -p should work though. |
Hi there! Many thanks for your reply - I know this is a pain, but it is for the greater good :) I've tried joining the arguments into a string, and concatenating this with the command, but unfortunately the
There is the plain
In both cases a copy/paste of the command as listed in the error messages executes without issue. I remain convinced that this is caused by some oddity in how |
This doesn't work when a tty doesn't exist, so if running from a web server or cron job won't work. I commented out this line in main.cpp line 475
|
So how can we turn this into a proper fix? |
Ola, your comment tripped my email and got me paying attention again. I'll take a look and try to post something asap. ~g |
Hi, I am doing a similar thing in PHP, the way I resolved the issue was to pass the text in through stdin by echoing the text through a pipe into nanotts, this is not perfect, but does resolve the issue, I am working on a better implementation for PHP however (will probably just pass directly through pico rather than via nano as nano is simply a wrapper for pico from what I can tell.
|
I got the same problem and finally use a simple bash wrapper as a workaround:
|
Trying to talk to nanotts from Node.JS i get an error regardless of how I format the command string:
How should I format my command line to avoid this?
The text was updated successfully, but these errors were encountered: