A RESTful API layer to use VOICEROID2 as a service.
- VOICEROID RESTful APIs: Provides RESTful APIs for VOICEROID2. Uses pyvcroid2 internally; the Python wrapper for VOICEROID DLL.
- Compressed Audio: Provides the encoding to the format that is supported by ffmpeg and pydub.
- Cache: Returns cache if the requested params are completely same to enhance the perfomance.
NOTE: This library supports Windows OS only. Tested on Python 3.8.
-
Install the dependencies:
- VOICEROID2 (x64 version is required) π https://www.ah-soft.com/history/2020.html
- ffmpeg: Audio converter π https://ffmpeg.org
- pydub: Python interface for ffmpeg (... and more features!) π
pip install pydub
- FastAPI: API framework π
pip install fastapi
- Uvicorn: ASGI server π
pip install uvicorn
-
Clone this repository.
-
Clone and put pyvcroid2 into the directory of pyvcroid2-api.
pyvcroid2-api-master
βββ pyvcroid2 π Here!
β βββ __init__.py
β βββ aitalk.py
β βββ pyvcroid2.py
βββ pyvcroid2api
β βββ __init__.py
β βββ controllers.py
: :
Start server.
$ uvicorn run:app
Install the HTTP client library.
$ pip install requests
Call API.
$ python client.py
Make sure that hello.mp3
is created and that sounds "γγγ«γ‘γ―" in Japanese.
You can customize pyvcroid2api.encoder.DefaultEncoder
directly or implement Encoder
and set it in run.py
instead.
class MyEncoder(Encoder):
:
VoiceroidEngine.setup(encoder=MyEncoder)
pyvcroid2 by @NkyokuP, is an awesome library that enables us using VOICEROID2 without GUI. pyvcroid2-api is just a wrapper of this library. Thank you!