smartgic / docker-mycroft

Mycroft AI Voice Assistant Docker images and docker-compose.yml files for x86_64, arm7vl and aarch64 CPU architectures.
https://hub.docker.com/u/smartgic
Apache License 2.0
41 stars 8 forks source link

Getting Mimic3 working with these containers #31

Closed MatthewJSalerno closed 2 years ago

MatthewJSalerno commented 2 years ago

I didn't build my own containers, I used the dockerhub images. This is my untested method to get mimic3 working with these images and the logic is sound. I should probably fork, but I'm on a time crunch and need to get it out of my head sooner than later and the time to build on my system is pathetic.

  1. /audio/Dockerfile - Create the voices target directory otherwise permissions get all messed up if the path doesn't exist within the image before a volume mount.

    RUN mkdir -p /home/mycroft/.config/pulse && \
    +  mkdir -p /home/mycroft/.local/share/mycroft/mimic3/voices && \
    pip3 install --no-cache-dir -r /home/mycroft/core/requirements/extra-audiobackend.txt boto3==1.24.74 \
    mycroft-plugin-tts-mimic3[all] && \
    rm -rf ~/.cache
  2. .env && .env-raspberrypi MIMIC3_MODELS_FOLDER=~/mycroft-mimic3-models/voices

  3. On host mkdir -p ~/mycroft-mimic3-models/voices/

  4. docker-compose.yml

    mycroft_audio:
    container_name: mycroft_audio
    ...
    volumes:
      - ...
      - ${MIMIC3_MODELS_FOLDER}:/home/mycroft/.local/share/mycroft/mimic3/voices
  5. For the first time startup, the user will need to download the voice they want. You can clone the Mimic3 repo but it's going to consume quite a bit of space. I just download the 1 voice I liked.

docker exec -it mycroft_audio mimic3-download en_US/vctk_low

  1. Now with the voice data downloaded, just restart the stack or just the mycroft_audio container.

With the above setup and the following mycroft.conf, Mimic3 should be working perfectly.

{
  "max_allowed_core_version": 21.2,
  "hotwords": {
    "hey mycroft": {
      "module": "ovos-precise-lite",
      "model": "~/models/precise-lite-models/wakewords/en/hey_mycroft.tflite",
      "sensitivity": 0.5,
      "trigger_level": 3
    }
  },
  "tts": {
    "module": "mimic3_tts_plug",
    "mimic3_tts_plug": {
        "voice": "en_US/vctk_low",
        "speaker": "p283",
        "length_scale": 1.2,
        "noise_scale": 0.667,
        "noise_w": 1.0
    }
  }
}
goldyfruit commented 2 years ago

I'll have look, thanks.

goldyfruit commented 2 years ago

Should be fixed, fill free to reopen if you still having an issue. Images are in building process, they should be available during the night.

MatthewJSalerno commented 2 years ago

It worked perfectly as long as you create the ~/mycroft-mimic3-voices directory (which is expected).

Thanks

goldyfruit commented 2 years ago

Thanks for the confirmation. The ~/mycroft-mimic3-voices directory creation is part of the README.md.