Skip to content

Instantly share code, notes, and snippets.

@ueponx
Created March 15, 2024 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ueponx/9d48b785c1d7fe6a837a0e8b82d863a8 to your computer and use it in GitHub Desktop.
Save ueponx/9d48b785c1d7fe6a837a0e8b82d863a8 to your computer and use it in GitHub Desktop.
RaspberryPi OSにvoicevox_coreをインストール・テストする手順
from pathlib import Path
from voicevox_core import VoicevoxCore, METAS
import sys, os
core = VoicevoxCore(open_jtalk_dict_dir=Path("./open_jtalk_dic_utf_8-1.11"))
speaker_id = 1 # 1:ずんだもん,2:四国めたん
text = sys.argv[1]
if not core.is_model_loaded(speaker_id):
core.load_model(speaker_id)
wave_bytes = core.tts(text, speaker_id)
with open("./" + text + ".wav", "wb") as f:
f.write(wave_bytes)
mkdir voicevox
cd voicevox/
python -m venv voicevox
source voicevox/bin/activate
wget https://github.com/VOICEVOX/voicevox_core/releases/download/0.14.0/voicevox_core-0.14.0+cpu-cp38-abi3-linux_aarch64.whl
pip install voicevox_core-0.14.0+cpu-cp38-abi3-linux_aarch64.whl
wget https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-aarch64-1.13.1.tgz
tar zxvf onnxruntime-linux-aarch64-1.13.1.tgz
ln -s onnxruntime-linux-aarch64-1.13.1/lib/libonnxruntime.so.1.13.1
wget https://jaist.dl.sourceforge.net/project/open-jtalk/Dictionary/open_jtalk_dic-1.11/open_jtalk_dic_utf_8-1.11.tar.gz
tar xzvf open_jtalk_dic_utf_8-1.11.tar.gz
python ./voicevox.py ずんだもんなのだ
aplay ずんだもんなのだ.wav
deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment