it seems your “Talk” programm can’t cope with double quotes. Have you tried the whole thing from the commandline?
Maybe you need single quotes around your sentence. Or double-double quotes, like talk ““Lorem ipsum dolor amed””
Manually doing it in the command line results in the following:
talk “my sentence 123” <— Success
talk ‘my sentence 123’ <—Success
Copying the output from the openhab log: executed commandLine 'talk “my speech string is great”'
is the same as the first one of these two examples, right?
executeCommandLine(‘talk “Dimming the light”’) <— results in it saying: Dimming.
executeCommandLine(“talk “Dimming the light””) <— results in it saying: Dimming.
Nope, can’t get it to work What you wrote in that post just gives “Dimming backslash”. Double or single quotes doesn’t seem to make a difference, tried multiple ways.
Using @@ works fine as long as i do it manually in the command line but when openhab does it, it fails completely.
I’m starting to feel it must be the exec binding that parses stuff strangely…
Edit: Or not… it works using say (other TTS software). It must be my program after all but don’t get how… Will look over later.
Edit2: Say works because it can take arguments like: say dimming the light <— without quotes.
Will probably just add support for this in my program even though it should be possible to pass a string within quotes.
Fixed this using $* in my bash program. Making it take all arguments as one string. Still believe the exec binding has some issues though. This was more of a work around.
few years ago but i have a similar problem. I want to run a python3 tts script with takes a
perl script:
if __name__ == "__main__":
# Check if any arguments were provided
if len(sys.argv) < 2:
print("Please provide text to convert to speech.")
sys.exit(1)
print("Tlumacze:", sys.argv)
# Join all arguments into a single string for text input
input_text = " ".join(sys.argv[1:])
text_to_speech_file(input_text)
Exec output: “2” instead of text is being parsed by the script * { "count": 1 }Tlumacze: ['/etc/openhab/misc/play.py', **'2'**] A new audio file was saved successfully at /srv/music/output.mp3
Tried different types of INPUT Item string the last one used is :
items.getItem(OWN_tone_text_to_speech_on_google_speaker_w_garazu_Input).sendCommand('"Brama się zamyka"')
Fixed this changing the thing configuration by formating "%2$s" part in think configuration
UID: exec:command:d75d7f7157
label: OWN tone text to speech on google speaker w garazu
thingTypeUID: exec:command
configuration:
transform: REGEX((.*))
interval: 0
autorun: true
command: python3 /etc/openhab/misc/play.py "%2$s\"
timeout: 3