Crocotta

Text to speech (TTS) integration

Text-to-speech client. It enables data exchange with the TTS service by sending text values to it and receiving the generated audio stream. Access to the TTS website is provided using MRCP technology.

Configuration

voice.gateway.crocotta {
  services: [
    {
      technology = "mrcp"
      ssml-formatter = REMOVE_PUNCTUATION_FROM_LAST_PROSODY_END
      tts-synthesis-timeout = 20s
      synthesis-caching {
        type = MEMORY
        memory {
          synthesis-expiration-duration = 5m
          max-size-of-cache = 10000
        }
      }

      mrcp {
        tts-consumer-mrcp {
          network {
            interface: ens224
            port: 5072
          }
          executor.scheduler.capacity = 50
          pbx.sound {
            rtp {
              port {
                min: 31100
                max: 32100
              }
              jitter: 5
            }
            clock.rate: 8000
          }
          sip.port.protocol {
            receive: [udp]
            send: udp
          }
          sip.nat {
            stunEnabled: false
            stunServerAddress: "stun.example.com"
            stunServerPort: 3478
            stunConnectionTimeout: 1s
          }
        }
        engine {
          host = example.com
          port = 5060
          name = "techmo-pl"
        }
      }
    }
  ]

  api {
    base-url = "http://0.0.0.0:8083"
    api-key: "xxx"
  }

  service-availability {
    ping-interval = 10d
    failure-limit = 10
    failure-time-window = 5m
  }


  database {
    username = "vg-admin"
    password = ${DB_PASS}
    url = "jdbc:postgresql://example.com:5001/voice-gateway"
    driver = org.postgresql.Driver
    show-sql = false
    persistence = "postgres_pu"
    schema = "crocotta"
    liquibase.enabled: false
    db-properties {
      hibernate.generate_statistics = true
      hibernate.jmx.enabled = true
      hibernate.hikari.registerMbeans = true
      hibernate.hikari.poolName = crocottaHikariCP
    }
    cache {
      number-of-days-to-keep: 30
      number-of-most-recent-synthesis: 10000
      cleanup-job-cron: "0 0 7 * * ?"
    }
  }
}

Field description

  • mrcp - configuration of network and technological parameters for access to the TTS service
  • database - connection parameters to the Postgresql database
  • service-availability - configuration for checking the availability of the TTS service
  • api - configuration of access to the REST API for the website

The component stores temporary and configuration data in the Redis database and requires an instance of such a database to function properly.

TTS Cache

Crocotta be default is using mixed approach to cache: recordings are cached in DB and also in memory to improve performance. Weather caching is enabled or not is defined in Voice Channel settings in admin UI.