diff --git a/Dockerfile b/Dockerfile index 06ebb7c..cea7522 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,7 +58,7 @@ RUN --mount=type=cache,id=pip-requirements,target=/root/.cache/pip \ ./install.sh # Download default voice -COPY voices/ /root/.local/share/mycroft-mimic3-tts/voices/ +COPY voices/ /root/.local/share/mycroft/mimic3/voices/ RUN .venv/bin/mimic3-download 'en_UK/apope_low' # ----------------------------------------------------------------------------- @@ -90,7 +90,7 @@ RUN useradd -ms /bin/bash mimic3 COPY --from=build /home/mimic3/app/ ./ # Copy pre-downloaded voice(s) -COPY --from=build /root/.local/share/mycroft-mimic3-tts/voices/ /usr/share/mycroft-mimic3-tts/voices/ +COPY --from=build /root/.local/share/mycroft/mimic3/voices/ /usr/share/mycroft/mimic3/voices/ # Run test COPY tests/* ./tests/ diff --git a/Dockerfile.debian b/Dockerfile.debian index 6678436..4902542 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -124,11 +124,11 @@ RUN mkdir -p "${package_dir}/DEBIAN" && \ envsubst \ < "debian/control.in.${TARGETARCH}${TARGETVARIANT}" \ > "${package_dir}/DEBIAN/control" && \ - mkdir -p "${package_dir}/usr/lib/mycroft-mimic3-tts" && \ - rsync -av "dist/mimic3/" "${package_dir}/usr/lib/mycroft-mimic3-tts/" && \ + mkdir -p "${package_dir}/usr/lib/mycroft/mimic3" && \ + rsync -av "dist/mimic3/" "${package_dir}/usr/lib/mycroft/mimic3/" && \ mkdir -p "${package_dir}/usr/bin/" && \ rsync -av "debian/bin/" "${package_dir}/usr/bin/" && \ - export dest_voice_dir="${package_dir}/usr/share/mycroft-mimic3-tts/voices/en_UK/apope_low" && \ + export dest_voice_dir="${package_dir}/usr/share/mycroft/mimic3/voices/en_UK/apope_low" && \ mkdir -p "${dest_voice_dir}" && \ rsync -av "voices/en_UK/apope_low/" "${dest_voice_dir}/" && \ cd /package && \ diff --git a/Dockerfile.dist b/Dockerfile.dist index d5306c9..b6b8dcb 100644 --- a/Dockerfile.dist +++ b/Dockerfile.dist @@ -88,7 +88,7 @@ RUN --mount=type=cache,id=pip-requirements,target=/root/.cache/pip \ mycroft-mimic3-tts # Download default voice -COPY voices/ /root/.local/share/mycroft-mimic3-tts/voices/ +COPY voices/ /root/.local/share/mycroft/mimic3/voices/ RUN .venv/bin/mimic3-download 'en_UK/apope_low' # Run test diff --git a/Dockerfile.gpu b/Dockerfile.gpu index 8361f2a..b7c467f 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -53,6 +53,9 @@ RUN sed -i 's/onnxruntime/onnxruntime-gpu/' mimic3-tts/requirements.txt RUN --mount=type=cache,id=pip-requirements,target=/root/.cache/pip \ ./install.sh +# Copy default voice +COPY voices/ /usr/local/share/mycroft/mimic3/voices/ + RUN useradd -ms /bin/bash mimic3 USER mimic3 diff --git a/Dockerfile.plugin b/Dockerfile.plugin index e2b2727..8a93060 100644 --- a/Dockerfile.plugin +++ b/Dockerfile.plugin @@ -101,7 +101,7 @@ RUN --mount=type=cache,id=pip-requirements,target=/root/.cache/pip \ mycroft-plugin-tts-mimic3 # Download default voice -COPY voices/ /root/.local/share/mycroft-mimic3-tts/voices/ +COPY voices/ /root/.local/share/mycroft/mimic3/voices/ RUN mycroft-core/.venv/bin/mimic3-download 'en_UK/apope_low' # Enable plugin diff --git a/Dockerfile.sample b/Dockerfile.sample index 4e3e2bb..a662590 100644 --- a/Dockerfile.sample +++ b/Dockerfile.sample @@ -55,7 +55,7 @@ RUN --mount=type=cache,id=pip-requirements,target=/root/.cache/pip \ ./install.sh # Download default voice -COPY voices/ /root/.local/share/mycroft-mimic3-tts/voices/ +COPY voices/ /root/.local/share/mycroft/mimic3/voices/ RUN .venv/bin/mimic3-download 'en_UK/apope_low' # Generate sample diff --git a/Jenkinsfile b/Jenkinsfile index 9939368..c8102d6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,7 +18,7 @@ // Jenkins pipeline for building Mimic 3 artifacts. // // Requires Docker buildx: https://docs.docker.com/buildx/working-with-buildx/ -// Assumes the en_UK/apope_low voice is in /home/jenkins/.local/share/mycroft-mimic3-tts/voices +// Assumes the en_UK/apope_low voice is in /home/jenkins/.local/share/mycroft/mimic3/voices pipeline { agent any @@ -27,7 +27,7 @@ pipeline { DOCKER_BUILDKIT = '1' DOCKER_PLATFORM = 'linux/amd64,linux/arm64,linux/arm/v7' DEFAULT_VOICE = 'en_UK/apope_low' - DEFAULT_VOICE_PATH = '/home/jenkins/.local/share/mycroft-mimic3-tts/voices' + DEFAULT_VOICE_PATH = '/home/jenkins/.local/share/mycroft/mimic3/voices' } stages { diff --git a/README.md b/README.md index d1b8fd9..71046e7 100644 --- a/README.md +++ b/README.md @@ -103,28 +103,28 @@ Or you can manually run the web server with: docker run \ -it \ -p 59125:59125 \ - -v "${HOME}/.local/share/mimic3:/home/mimic3/.local/share/mimic3" \ + -v "${HOME}/.local/share/mycroft/mimic3:/home/mimic3/.local/share/mycroft/mimic3" \ 'mycroftai/mimic3' ``` -Voices will be automatically downloaded to `${HOME}/.local/share/mycroft-mimic3-tts/voices` +Voices will be automatically downloaded to `${HOME}/.local/share/mycroft/mimic3/voices` ### Debian Package Grab the Debian package from the [latest release](https://github.com/mycroftAI/mimic3/releases) for your platform: -* `mimic3-tts__amd64.deb` +* `mycroft-mimic3-tts__amd64.deb` * For desktops and laptops (`x86_64` CPUs) -* `mimic3-tts__arm64.deb` +* `mycroft-mimic3-tts__arm64.deb` * For Raspberry 3/4 and Zero 2 with [64-bit Pi OS](https://www.raspberrypi.com/news/raspberry-pi-os-64-bit/) -* `mimic3-tts__armhf.deb` +* `mycroft-mimic3-tts__armhf.deb` * For Raspberry Pi 1/2/3/4 and Zero 2 with 32-bit Pi OS Once downloaded, install the package with (note the `./`): ``` sh -sudo apt install ./mimic3-tts__.deb +sudo apt install ./mycroft-mimic3-tts__.deb ``` Once installed, the following commands will be available in `/usr/bin`: @@ -200,7 +200,7 @@ Mimic 3 references voices with the format: For example, the default [Alan Pope](https://popey.me/) voice key is `en_UK/apope_low`. The [CMU Arctic voice](https://github.com/MycroftAI/mimic3-voices/tree/master/voices/en_US/cmu-arctic_low) contains multiple speakers, with a commonly used voice being `en_US/cmu-arctic_low#slt`. -Voices are automatically downloaded from [Github](https://github.com/MycroftAI/mimic3-voices) and stored in `${HOME}/.local/share/mimic3` (technically `${XDG_DATA_HOME}/mimic3`). You can also [manually download them](#downloading-voices). +Voices are automatically downloaded from [Github](https://github.com/MycroftAI/mimic3-voices) and stored in `${HOME}/.local/share/mycroft/mimic3` (technically `${XDG_DATA_HOME}/mycroft/mimic3`). You can also [manually download them](#downloading-voices). ## Running @@ -229,7 +229,7 @@ For example: mimic3-download 'en_US/*' ``` -will download all U.S. English voices to `${HOME}/.local/share/mimic3`. +will download all U.S. English voices to `${HOME}/.local/share/mycroft/mimic3/voices`. See `mimic3-download --help` for more options. diff --git a/mimic3_tts/const.py b/mimic3_tts/const.py index ff55e1d..a55f839 100644 --- a/mimic3_tts/const.py +++ b/mimic3_tts/const.py @@ -22,7 +22,7 @@ DEFAULT_LANGUAGE = "en_UK" DEFAULT_VOICES_URL_FORMAT = ( "https://github.com/MycroftAI/mimic3-voices/raw/master/voices/{lang}/{name}" ) -DEFAULT_VOICES_DOWNLOAD_DIR = Path(XDG().XDG_DATA_HOME) / "mimic3" / "voices" +DEFAULT_VOICES_DOWNLOAD_DIR = Path(XDG().XDG_DATA_HOME) / "mycroft" / "mimic3" / "voices" DEFAULT_VOLUME = 100.0 DEFAULT_RATE = 1.0 diff --git a/mimic3_tts/tts.py b/mimic3_tts/tts.py index ced5348..cfff1be 100644 --- a/mimic3_tts/tts.py +++ b/mimic3_tts/tts.py @@ -160,12 +160,12 @@ class Mimic3TextToSpeechSystem(TextToSpeechSystem): """Get list of directories to search for voices by default. On Linux, this is typically: - - $HOME/.local/share/mycroft-mimic3-tts/voices - - /usr/local/share/mycroft-mimic3-tts/voices - - /usr/share/mycroft-mimic3-tts/voices + - $HOME/.local/share/mycroft/mimic3/voices + - /usr/local/share/mycroft/mimic3/voices + - /usr/share/mycroft/mimic3/voices """ return [ - Path(d) / "mycroft-mimic3-tts" / "voices" + Path(d) / "mycroft" / "mimic3" / "voices" for d in XDG().XDG_DATA_DIRS.split(":") ]