synesthesiam / voice2json

Command-line tools for speech and intent recognition on Linux
MIT License
1.09k stars 63 forks source link

MaryTTS doesn't work in official Docker image due to lack of Java #1

Closed jasontbradshaw closed 4 years ago

jasontbradshaw commented 4 years ago

Using a "bin" script of:

#!/usr/bin/env bash
docker run \
  -i \
  -v "${HOME}:${HOME}" \
  -w "$(pwd)" \
  -e "HOME=${HOME}" \
  --user "$(id -u):$(id -g)" \
  'synesthesiam/voice2json' "$@"

and an appropriately-trained profile, I get the following result:

$ voice2json speak-sentence 'hello.'                      
[14] Failed to execute script __main__
Traceback (most recent call last):
  File "voice2json/__main__.py", line 1766, in <module>
  File "voice2json/__main__.py", line 353, in main
  File "voice2json/__main__.py", line 1596, in speak
  File "voice2json/__main__.py", line 1723, in speak_marytts
  File "voice2json/__main__.py", line 1666, in start_marytts
  File "subprocess.py", line 709, in __init__
  File "subprocess.py", line 1344, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'java': 'java'

The above command with the exact same profile works as expected if I use the following custom Dockerfile:

FROM ubuntu:bionic

RUN \
  apt-get update -y \
  && apt-get install -y \
    sox \
    jq \
    alsa-utils \
    espeak-ng \
    sphinxtrain \
    perl

COPY voice2json_1.0_amd64.deb /voice2json.deb

RUN apt install -y /voice2json.deb

ENTRYPOINT ["voice2json"]

It seems all that's missing is having a JRE installed in the official image, which seems to be installed by the .deb as one of its required dependencies.

synesthesiam commented 4 years ago

Moved to an external MaryTTS Docker image: https://github.com/synesthesiam/docker-marytts