...
var VoiceManager = Java.type("org.openhab.core.voice.VoiceManager");
....
VoiceManager.say(sprechText, "voicerss:deDE", AudioSink);
.....
I’m getting this error: Script execution of rule with UID 'SagEtwas' failed: TypeError: VoiceManager.say is not a function in <eval> at line number 31
Since say isn’t a static method I tried also to create an instance of VoiceManager with
var VoiceManager = Java.type("org.openhab.core.voice.VoiceManager");
var myvoice = new VoiceManager();
...
myvoice.say(sprechText, "voicerss:deDE", AudioSink);
Script execution of rule with UID 'SagEtwas' failed: TypeError: Can not create new object with constructor org.openhab.core.voice.VoiceManager with the passed arguments; they do not match any of its method signatures. in <eval> at line number 3
Where would I find the needed arguments to create a VoiceManager? I looked here: https://openhab.org/javadoc/latest/org/openhab/core/voice/voicemanager
Thanks for that one. Now my rule-suit is completly converted to JavaScript!
Learned a lot again!
[Edit:]
That statement was a bit early. The JavaScript rule runs through without an error, however no TTS-soundfile is played. Using the DSL-rule it works, searching…
[Edit2]
The last problem was caused by a switch case problem, the sound was played somewhere else (multi-room problem).
I try to convert my dsl rules to ECMA rules in oh3 and one of my last problems is TTS and the say command. Did you solve your mentioned problems and can I use your jaca code also for a oh3 ui ecma rule?