Skip to content

Instantly share code, notes, and snippets.

@aoirint
Last active April 12, 2024 20:59
Show Gist options
  • Save aoirint/ad22a8de2a1217aadcff8e06fdefe9f4 to your computer and use it in GitHub Desktop.
Save aoirint/ad22a8de2a1217aadcff8e06fdefe9f4 to your computer and use it in GitHub Desktop.
Wine in Docker + 棒読みちゃん (Ubuntu)

Wine in Docker + 棒読みちゃん (Ubuntu)

mecab-0.996.exeをダウンロード。

https://taku910.github.io/mecab/#download

BouyomiChan_0_1_11_0_Beta21.zipをダウンロード。

https://chi.usamimi.info/Program/Application/BouyomiChan/

WineのDockerイメージをpull、もしくはURLからgit cloneしてmake build-ubuntu-devel(20-60分くらいかかる。いろいろ入れているから長いのだが、どうにかならないだろうか..)。

docker pull aoirint/wine:ubuntu-devel

https://github.com/aoirint/wine-docker/commit/42cb9042549abd822faa15829217103ba63b72c1

mecabのインストーラと棒読みちゃんの実行ファイルがあるディレクトリをマウントに含めてコンテナを起動。

docker run --rm \
    --group-add "$(getent group audio | cut -d: -f3)" \
    -e "PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native" \
    -v "${XDG_RUNTIME_DIR}/pulse/native/:${XDG_RUNTIME_DIR}/pulse/native" \
    -v "${HOME}/.config/pulse/cookie:/pulseaudio/cookie" \
    -e "HOST_UID=$(id -u)" \
    -e "HOST_GID=$(id -g)" \
    -e LANG=ja_JP.UTF-8 \
    -e DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v "$PWD:/work" \
    -w /work \
    -u root \
    --entrypoint "" \
    -it \
    aoirint/wine:ubuntu-devel bash

MeCabのインストーラを実行してインストール(初回起動に失敗することがあるが、再実行を試すとうまくいくかも)。 「辞書の文字コードの選択」ではSHIFT-JISを選択する(UTF-8を選ぶと分析の出力が文字化けして、合成結果が無音になる)。

gosu user wine mecab-0.996.exe

初回実行時エラーの例。

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  130 (MIT-SHM)
  Minor opcode of failed request:  3 (X_ShmPutImage)
  Value in failed request:  0x160
  Serial number of failed request:  512
  Current serial number in output stream:  514

棒読みちゃんを実行。

gosu user wine BouyomiChan.exe

こちらも初回実行時にエラーが出ることがあるので、再試行する。

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  130 (MIT-SHM)
  Minor opcode of failed request:  3 (X_ShmPutImage)
  Value in failed request:  0x320
  Serial number of failed request:  1094
  Current serial number in output stream:  1097
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment