@ActionDoc(text="says a given text through the default TTS service with a given voice")
static public void say(@ParamDoc(name="text") Object text,
@ParamDoc(name="voice") String voice,
@ParamDoc(name="device") String device) {
if(StringUtils.isNotBlank(text.toString())) {
TTSService ttsService = getTTSService(MultimediaActivator.getContext(), System.getProperty("osgi.os"));
if(ttsService==null) {
ttsService = getTTSService(MultimediaActivator.getContext(), "any");
}
if(ttsService!=null) {
ttsService.say(text.toString(), voice, device);
} else {
logger.error("No TTS service available - tried to say: {}", text);
}
}
}