An offline (non cloud-based) TTS that sounds quite good

I found an offline TTS solution that sounds quite good: opentts. I can play it on Google nest speakers quite easily.

Example (make sure to try coqui-tts-ljspeech): OpenTTS Voice Samples

To use it, I set up a docker container for opentts using docker-compose:

services:
  opentts:
    image: synesthesiam/opentts:en
    container_name: opentts
    command: --cache --no-espeak
    ports:
      - 5500:5500

To use it in my rules: (example in jruby):

require 'cgi'

# This overrides the jruby library's `say` method that calls OpenHAB's TTS Voice.say
def say(msg, voice: 'coqui-tts:en_ljspeech')
  msg = CGI.escape(msg)
  url = "http://192.168.1.10:5500/api/tts?voice=#{voice}&text=#{msg}"
  Audio.playStream(url)
end

say "Hello, I'm your new offline TTS voice"

It would be great if coqui-tts can be added to openhab as a TTS engine

1 Like