Skip to main content

voicevox_service 0.1.0 copy "voicevox_service: ^0.1.0" to clipboard
voicevox_service: ^0.1.0 copied to clipboard

A Dart library for accessing common Voicevox Core APIs wrapper using, FFI.

Voicevox Service for Dart #

このパッケージのメインページは以下となります。

https://pub.dev/packages/voicevox_service

Requirement #

VoicevoxCoreをWindows上で簡易的に使用するためのラッパーです。
64bit専用で、ffiを利用しています。
依存関係は以下の通りとなります。

  • ffi: ^2.1.4
  • voicevox_core: ^0.2.0
  • win32: ^5.15.0

また使用するファイルは、本家Voicevox for Windowsに準拠しています。
フォルダ構成は以下の通りです。

vv-engine
 │  voicevox_core.dll
 │  voicevox_onnxruntime.dll
 │
 ├─engine_internal
 │  └─pyopenjtalk
 │      └─open_jtalk_dic_utf_8-1.11
 │         │  char.bin
 │         │  COPYING
 │         │  left-id.def
 │         │  matrix.bin
 │         │  pos-id.def
 │         │  rewrite.def
 │         │  right-id.def
 │         │  sys.dic
 │         │  unk.dic
 │
 └─model
    │  0.vvm
    │  1.vvm
    │  2.vvm
    │  …以下略

当github上にあるvv-engineには、最低限必要なファイルがあります。
本家のコピーライトに準拠した上で、コピーしてお使いください。

Windowsに依存しているのは、vv-engine内のvoicevox_onnxruntime.dllを使用するためです。
voicevox_onnxruntime.dllを直接指定する方法がないため、カレントを移して強制的に読み込ませています。
vv-engine内のdllに依存したくない場合は、以下のように、useEngineDllにfalseを指定して回避します。

import 'package:voicevox_service/voicevox_service.dart';

void main() {
  final service = VoicevoxService();
  // vv-engine内にあるdllを利用せずに初期化します
  // この場合、カレントにあるvoicevox_core、voicevox_onnxruntimeを利用します
  final result = service.init(useEngineDll: false);
  // and more...
}

Note #

話者名、スタイル名を指定して、IDを逆引きして呼び出すことのできる試みを行っています。
ByNameの末尾のつく関数で、speakerNameに話者名、styleNameにスタイル名を指定可能です。
指定可能な候補は、以下のサイトの「トーク」のものとなります。

https://github.com/VOICEVOX/voicevox_vvm/blob/main/README.md

具体的な使用方法は、example/main.dartをご確認ください。

Author #

yamahara

0
likes
145
points
7
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Dart library for accessing common Voicevox Core APIs wrapper using, FFI.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

ffi, voicevox_core, win32

More

Packages that depend on voicevox_service