I reinstalled the bundle but it pulled the old. is it already merged for the nighty build?
Not yet merged.
Right, I didnât address the masterVolume commands yet, they are still the old code. They probably do not make much sense anymore, probably rather a setVolume(String sinkID)
should be there.
No, I would leave that separate. Usually volume control is independent of the content that is played. And if you have use cases where you need to say something loud, use setVolume
and say
within a rule.
With snapshot 595 running Windows 10, I observed the following bugs and German language.
say command is not working
When defining âmaryttsâ as default language:
say(âTestâ)
11:06:31.674 [ERROR] [se.smarthome.core.voice.VoiceManager] - Error saying âTestâ: Unable to find a voice for language de
say(âdies ist ein Test das ist ein Test ist ein Testâ,âmarytts:bits1hsmmâ,âenhancedjavasoundâ)
working
say(âdies ist ein Test das ist ein Test ist ein Testâ,âmarytts:bits3hsmmâ,âsonos:PLAY1:Schlafzimmerâ)
or also
say(âdies ist ein Test das ist ein Test ist ein Testâ,âmarytts:bits3hsmmâ,âwebaudioâ)
working but not understandable.
Sounds like Donald Duck but cannot understand words.
Seems to be played much too fast.
Shall I create a issue or too early?
This is already tracked: VoiceManager fails to find suitable voice · Issue #2352 · eclipse-archived/smarthome · GitHub
It seems that the Mary server provides the wrong sampling rate for bits3hsmm. Feel free to enter an issue at Pull requests · openhab/openhab2-addons · GitHub - but donât expect me to find time to look into that myself, I would hope that some other MaryTTS user might jump in here.
Hi @Lolodomo,
Iâve updated to build # 598 and tested voicerss using the karaf command
smarthome:voice say ("BlaBla")
This works!
No Iâm trying it from within a rule with that:
rule "TestVoice"
when
Item TestSomething changed
then
say("Hallo Echo!","voicerss:deDE","sonos:PLAY1:RINCON_xxxxx1400")
end
When trying to use the say command in a rule only the last string that was entered in karaf is being played (the âBlaBlaâ is plaed, not âHallo Echo!â)
Am I missing something?
Parentheses in case of console commands are mot required. Just try: smarthome:voice say blabla
But no idea if it can be the source of your problem.
My problem is the other way around, using the console command works as expected. Using it from within a rule doesnât.
Hi,
Iâve tested the SetMasterVolume from within a rule and I canât seem to set anything else then 0 or 1.0(i.e. 100%).
I tried:
setMasterVolume(0,5) Sets 0!
setMasterVolume(0.5) Returns " Cannot convert number literal to typeorg.eclipse.smarthome.core.library.types.PercentType"
setMasterVolume(â0.5â) Returns âCould not invoke method: org.eclipse.smarthome.model.script.actions.Audio.setMasterVolume(org.eclipse.smarthome.core.library.types.PercentType) on instance: nullâ
Which syntax is needed?
Iâm on #build 627
for setting you have to use a â,â but as I understood Kai this code is non functional and will be replace by different APIs.
Did you try with values from 0 to 100?
@martin_klimke
Did try it with â,â. It seems that the value gets truncated to zero.
@Kai
Sorry forgot to mention that one. Values above 1 are neglected because out of bounce (0-1).
Can you figure the test with the doorbell, with volume 0 and 1!
There was another possible way, which I missed:
setMasterVolume(0.2F)
So it does use the â.â, however the âFâ for float was missing.
If you like to set percentage values instead of float numbers, you can use
setMasterVolume(new PercentType(20))
No more yelling, because of this really loud âdoorbellâ
[Edit:]
My next problem is the correct syntax for the say command.
If I use only one string input, this text will be said by the default voice through the default audio-sink.
What is the correct syntax for the voice, I used âvoicerss:deDEâ as specified through Karaf as an available voice or if I ommit the second string like say(MyString, ,âMySonosPlayerâ), both cases return an error:
Could not invoke method: org.eclipse.smarthome.model.script.actions.Voice.say(java.lang.String,java.lang.String) on instance: null
I have the âsayâ command working in the version with one string (i.e. using both default voice and audio sink).
However I canât get the overloaded versions with more then one string working.
The second string is supposed to be voice (The description say: âthe name of the voice to use or null, if the default voice should be used. If the voiceId is fully qualified (i.e. with a tts prefix), the according TTS service will be used, otherwise the voiceId is assumed to be available on the default TTS service.â)
What is the correct syntax to name the voice? Iâm using VoiceRSS:deDE, @Lolodomo reported it working with âvoicerss:frFRâ, so in my case it should be âvoicerss:deDEâ. However I get an error as posted above.
Should it work that way or am I pushing it to hard for the moment?
You have to use one of the entries (first part of the line) returned by the command âsmarthome:voice voicesâ. So your voice id is âvoicerss:deDEâ and not âVoiceRSS:deDEâ. Case is probably important (not verified).
On my side, I am using in rules the âsayâ action with 3 parameters: text, voice and audio sink. It is working, the voice is set to âvoicerss:frFRâ.
For the available audio sinks, run the command âsmarthome:audio sinksâ and then use one of the returned values as third parameter for the say action. I only tested with Sonos as audio sink.
I did use the âlowercaseâ version for the voice!
I tried:
say(SayCommand.state,âvoicerss:deDEâ)
resulted in
17:34:04.875 [ERROR] [.script.engine.ScriptExecutionThread] - Rule âSagEtwasâ: An error occured during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.Voice.say(java.lang.String,java.lang.String) on instance: null
or
say(SayCommand.state,âvoicerss:deDEâ,âsonos:PLAY1:RINCON_???1400â)
resulted in
Rule âSagEtwasâ: An error occured during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.Voice.say(java.lang.String,java.lang.String,java.lang.String) on instance: null
however
say(SayCommand.state)
is working like a charm!
Iâm on build #627
Try this: say(SayCommand.state.toString,âvoicerss:deDEâ)
This should work.
I know, there is something strange, say with 1 parameter takes one Object while say with 2 or 3 parameters takes one String as first parameter.
Probably something to change that I have already commented.
Bingo!
Thanks for that hint, yes I was feeling really strange already for all that false trys!
Next thing is to incooperate a selection of the audio sink to be used by the command, I was hoping that the Name intead of the UDN could be used. So I need to populate a list with the names and then select the correspondig UDN for the say command.
Not very fancy, however working!
On a template widget in HABpanel
Lautsprecher and SayCommand are string items!
<div class="form-inline">
<div class="form-group">
<input type="text" class="form-control" no-snap-drag="true"
ng-model="myvalue" ng-value="itemValue('SayCommand')"></input>
<button type="button" class="btn btn-primary"
ng-click="sendCmd('SayCommand', myvalue)">Sag es!</button>
</div>
<div class="btn-group" uib-dropdown>
<button id="single-button" type="button" class="btn btn-primary" uib-dropdown-toggle>
{{itemValue('Lautsprecher')}} <span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li role="menuitem"><a ng-click="sendCmd('Lautsprecher', 'KĂŒche')">KĂŒche</a></li>
<li role="menuitem"><a ng-click="sendCmd('Lautsprecher', 'Wohnzimmer')">Wohnzimmer</a></li>
<li role="menuitem"><a ng-click="sendCmd('Lautsprecher', 'GĂ€stezimmer')">GĂ€stezimmer</a></li>
</div>
and the rule that actualy calls the âsayâ
rule âSaySomethingâ
when
Item SayCommand received update
then
var string AudioSink
switch AudioSink {
case Lautsprecher.state.toString==âKĂŒcheâ : AudioSink=âsonos:PLAY1:RINCON_xxx1400â
case Lautsprecher.state.toString==âGĂ€stezimmerâ : AudioSink=âsonos:PLAY1:RINCON_yyy1400â
default:AudioSink=âsonos:zzz1400â
}
say(SayCommand.state.toString,âvoicerss:deDEâ,AudioSink)
end