/VOICEVOX-API-unity

Binds VOICEVOX text to speech API to pure C# on Unity.

Primary LanguageC#MIT LicenseMIT

VOICEVOX-API-unity

Binds VOICEVOX text to speech API to pure C# on Unity.

See also official page.

Support version is 0.14.3.

Avaiable API

  • Query Creation
    • /audio_query
    • /audio_query_from_preset
  • Query Editing
  • Synthesis
    • /synthesis
    • /cancellable_synthesis
    • /multi_synthesis
    • /morphable_targets
    • /synthesis_morphing
  • Otherwise
  • Library
  • User Dictionary
  • Settings

How to import by UnityPackageManager

Add dependencies:

{
  "dependencies": {
    "com.mochineko.voicevox-api": "https://github.com/mochi-neko/VOICEVOX-API-unity.git?path=/Assets/Mochineko/VOICEVOX_API#0.2.1",
    "com.mochineko.relent": "https://github.com/mochi-neko/Relent.git?path=/Assets/Mochineko/Relent#0.2.0",
    "com.mochineko.relent.extensions.newtonsoft-json": "https://github.com/mochi-neko/Relent.git?path=/Assets/Mochineko/Relent.Extensions/NewtonsofJson#0.2.0",
    "com.unity.nuget.newtonsoft-json": "3.0.2",
    "com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask",
    ...
  }
}

to your mainfest.json.

If you have already used Newtonsoft.Json on your project, remove dependency:"com.unity.nuget.newtonsoft-json": "3.0.2",.

How to use speech synthesize from text by VOICEVOX API

  1. Launch your VOICEVOX server or application.
  2. If you change VOICEVOX server address from default, you have to set VoiceVoxBaseURL.BaseURL.
  3. Input text to synthesis speech.
  4. Create AudioQuery from text by QueryCreationAPI.
  5. Synthesize speech from AudioQuery by SynthesisAPI.
  6. Decode synthesized WAV file and play on Unity as you like.

A sample code with UniTask is this.

Changelog

See CHANGELOG.

3rd Party Notices

See NOTICE.

License

Licensed under the MIT license.