Where to set default TTS voice?

Ok, I feel completely stupid to ask this, but where does one define the default TTS voice to be used? and does that take the “mactts:Ellen” like format?

Sorry, Karel, I indeed still need to document this somewhere.

What you need to do is to add this to your services.cfg:

org.eclipse.smarthome.voice:defaultVoice.<ttsId>=<voiceId>

e.g.

org.eclipse.smarthome.voice:defaultVoice.mactts=Anna

As you can see, you can define a default voice per TTS, so you can have multiple lines for different TTS.

Hope this helps!

Hi. I’ve just started with openhab2 and I’m trying to enable voice. I’ve installed both MaryTTS and VoiceRSS through PaperUI.

I’m testing the config through Karaf with

  smarthome:voice say "hello"

however this generates the following error

2016-10-22 13:25:32.000 [ERROR] [se.smarthome.core.voice.VoiceManager] - Error saying 'hello ': Unable to find a voice for language en

I’ve updated the services.cfg file adding the entries

org.eclipse.smarthome.voice:defaultVoice.voicerss=default (en_GB)
org.eclipse.smarthome.voice:defaultVoice.marytts=cmu-slt-hsmm

Any thoughts?

Thanks

I can confirm that there is an issue with the voice selection. The workaround is to set the locale to “en” instead of “en_GB” in the Paper UI.

Hi

Thanks for the reply.

I’m still having problems. I’ve tried combinations of setting both the
language and Country / Region to en (and GB respectively), but I’m still
getting the following error.

2016-10-24 21:10:43.472 [ERROR] [se.smarthome.core.voice.VoiceManager] -
Error saying 'hello ': Unable to find a voice for language en

when I am running

openhab> smarthome:voice say ‘hello’

I think the VoiceRSS requires

en-gb English (Great Britain)

I have the following entries in my service.cfg file

# Config for voice
#org.eclipse.smarthome.voice:defaultVoice.voicerss=default (en_GB)
org.eclipse.smarthome.voice:defaultVoice.marytts=cmu-slt-hsmm

Thanks again.

Mike

I’ve also just spotted this in the openhab.log.

I’m running openhab on a Pine64 with longsleep.

2016-10-24 21:33:48.307 [ERROR] [.voice.mactts.internal.MacTTSService] -
Error while executing the ‘say -v ?’ command: Cannot run program “say”:
error=2, No such file or directory

I’d actually think that “default (en_GB)” is an invalid voice id used by VoiceRSS as ids should have no brackets or spaces. Probably better to use simply “en_GB” for it, would you agree @jo_hiller?

I am not surprised about this error. You should not expect the Mac OS X built-in TTS service to work on Linux :slight_smile:

OK,I’ve updated the voice config to change it to “en_GB”, but I’m still getting the “Unable to find a voice for language en” error.
Any other suggestions?

I’ve removed the macTTS service and now I’ll getting.

2016-10-24 22:20:35.484 [WARN ] [me.io.javasound.internal.AudioPlayer] - No line found: null
2016-10-24 22:20:35.485 [INFO ] [me.io.javasound.internal.AudioPlayer] - Available lines are:
2016-10-24 22:20:35.504 [INFO ] [me.io.javasound.internal.AudioPlayer] - interface SourceDataLine supporting 42 audio formats, and buffers of 0 to 1000000 bytes
2016-10-24 22:20:35.505 [INFO ] [me.io.javasound.internal.AudioPlayer] - interface Clip supporting 42 audio formats, and buffers of 0 to 1000000 bytes

Looks like progress :slight_smile: . Now to configure the audio…

@Mike_Hartley
I did not test, but I would assume that

org.eclipse.smarthome.voice:defaultVoice.voicerss=default

should be correct.

Looking at the code at https://github.com/openhab/openhab2-addons/blob/master/addons/voice/org.openhab.voice.voicerss/src/main/java/org/openhab/voice/voicerss/internal/VoiceRSSVoice.java#L52, the unique voice id is “default” (there is up to now only 1 voice, the default with a good quality).

The locales are a second dimension. I did mimic that approach just from MaryTTS.
That the console commend “smarthome:voice voices” shows it including the locale is same for MaryTTS.
@Kai Did I get something wrong?

You create multiple Voice instances in initVoices, all with the same “label” and thus all having the same UID - this is clearly wrong as the UID has to be unique. One Voice is always tight to one locale - a multi-language voice isn’t possible.

Aah OK, then I had wrong assumption. I will fix that