Coder Social home page Coder Social logo

rainyedge / voicevox_core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voicevox/voicevox_core

0.0 0.0 0.0 51.21 MB

無料で使える中品質なテキスト読み上げソフトウェア、VOICEVOXのコア

Home Page: https://voicevox.hiroshiba.jp/

License: MIT License

Python 4.71% Cython 0.34% Batchfile 0.07% C 0.41% CMake 0.25% C++ 94.21%

voicevox_core's Introduction

VOICEVOX CORE

VOICEVOX の音声合成コア。
Releases にビルド済みのコアライブラリ(.so/.dll/.dylib)があります。

(エディターは VOICEVOX 、 エンジンは VOICEVOX ENGINE 、 全体構成は こちら に詳細があります。)

環境構築

configure.pyを用いて環境構築を行う場合

python configure.py
pip install -r requirements.txt
pip install .
configure.pyを使わない場合

ONNX Runtimeのダウンロード

コアを利用するにはまず環境に対応した ONNXRUNTIME をダウンロードし、リポジトリにonnxruntimeというディレクトリ名で展開します。

動作確認済みバージョン

  • ONNX Runtime v1.9.0/v1.9.1

GPUを使用する場合

Windows, Linux上でnvidia製GPUを使用する場合、CUDA11.1,CUDNNのインストールに加えてGPU に対応した ONNXRUNTIME のダウンロードが必要です。

Raspberry Pi (armhf)の場合

Raspberry Pi 用の ONNX Runtime は以下からダウンロードできます。

動作には、libgomp のインストールが必要です。

コアライブラリのダウンロードと配置

まず Releases からコアライブラリが入った zip をダウンロードしておきます。

  1. まずReleasesからダウンロードしたコアライブラリのzipを、releaseというディレクトリ名で展開する。
  2. core/lib/ディレクトリを作成する。
  3. onnxruntime/libにある全てのファイルと、release/にあるcore.hcore/lib/にコピーする。
  4. release/内にある、自身の環境に対応したランタイムライブラリをcore/lib/にコピーし、名前をWindowsならcore.dllに、linuxならlibcore.soに、Macならlibcore.dylibに変更する。
    • (x64版WindowsでCPU版ライブラリを使いたいならcore_cpu_x64.dllcore.dllに変更)
  5. 以下のコマンドを実行する。
# インストールに必要なモジュールのインストール
pip install -r requirements.txt
# pythonモジュールのインストール
pip install .

注意

GPUの使用について

nvidia製GPUを搭載したWindows, Linux PCではCUDAを用いた合成が可能です。 CUDAを使用する場合、CUDA 11.1CUDNN をインストールした上で、環境構築時、上記例の代わりに

python configure.py --use_gpu

を実行する必要があります

MacOSの場合、CUDA の macOS サポートは現在終了しているため、VOICEVOX CORE の macOS 向けコアライブラリも CUDA, CUDNN を利用しない CPU 版のみの提供となります。

Raspberry Piでの使用について

Raspberry PiなどのarmhアーキテクチャPCでの使用では、環境構築時に https://github.com/VOICEVOX/onnxruntime-builder/releases にある独自ビルドのonnxruntimeを使用する必要があります。 そのため、環境にあったファイルのURLを取得し、上記例の代わりに

python configure.py --ort_download_link <独自ビルドonnxruntimeのURL>

を実行してください

また、動作には、libgomp のインストールが必要です。

sudo apt install libgomp1

サンプル実行

cd example/python

# サンプルコード実行のための依存モジュールのインストール
pip install -r requirements.txt
python run.py \
    --text "これは本当に実行できているんですか" \
    --speaker_id 1 \
    --root_dir_path="../../release"

# 引数の紹介
# --text 読み上げるテキスト
# --speaker_id 話者ID
# --use_gpu GPUを使う
# --f0_speaker_id 音高の話者ID(デフォルト値はspeaker_id)
# --f0_correct 音高の補正値(デフォルト値は0。+-0.3くらいで結果が大きく変わります)
# --root_dir_path onnxファイル等必要なファイルがあるディレクトリ

その他の言語

サンプルコードを実装された際はぜひお知らせください。こちらに追記させて頂きます。

API

core.h をご参照ください。

コアライブラリのビルド

Releases にあるビルド済みのコアライブラリを利用せず、自分で一からビルドする場合こちらを参照してください。ビルドにはONNXRUNTIMEに加えてCMake 3.16以上が必要です。 modelフォルダにあるonnxモデルはダミーのため、ノイズの混じった音声が出力されます

# C++モジュールのビルド
mkdir build
cd build
# もしダウンロードしたonnx runtimeが別のところにあるなら、以下のコマンドを
# cmake .. -DONNXRUNTIME_DIR=(ダウンロードしたonnx runtimeのパス) に変更する。
cmake ..
cmake --build . --config Release
cmake --install .
cd ..

# (省略可能) pythonモジュールのテスト
python setup.py test

# pythonモジュールのインストール
pip install .

cd example/python

python run.py \
    --text "これは本当に実行できているんですか" \
    --speaker_id 1 \
    --root_dir_path="../../model"

事例紹介

VOICEVOX ENGINE SHARP @yamachu ・・・ VOICEVOX ENGINE の C# 実装
Node VOICEVOX Engine @y-chan ・・・ VOICEVOX ENGINE の Node.js/C++ 実装

ライセンス

ソースコードのライセンスは MIT LICENSE です。

Releases にあるビルド済みのコアライブラリは別ライセンスなのでご注意ください。

voicevox_core's People

Contributors

hiroshiba avatar yosshi999 avatar aoirint avatar oyaki122 avatar y-chan avatar pickledchair avatar xuzijian629 avatar lapis256 avatar segu-g avatar eggplants avatar qwerty2501 avatar shigobu avatar tantan-tanuki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.