Can't run speech-dispatcher command from rule

I try to use speech dispatcher and execute spd-say command with executeCommandLine in rule:

val result = executeCommandLine("/usr/bin/spd-say -y anna ‘Attention!’", 5000)
logInfo(“Exec”, result)

Nothing happens and empty string is in the openhab log.
Any help?
Maybe there’s another way to use speech-dispatcher in openhab2?

Does executing the exact same command from the command line work when you run it as the openhab user?

I don’t use speed-dispatcher, but I do know that executeCommandLine can be a bit tricky when it comes to spaces and quotes. You could try something like this in your rule (replace space by @@ and/or use and escape double quotes):

val result = executeCommandLine("/usr/bin/spd-say@@-y@@anna@@\"Attention!\"", 5000)

Also, what is returned when you run spd-say from a command line? The empty result string might be normal behaviour.

sudo -u openhab -H spd-say attention
gives no output, but I hear “attention” from speaker.
But it runs from openhab rule with no sound

It’s OK now. I forgot to restart openhab after adding group audio