voicevox_core

Activity, over time

Daily observations from the public event archive.

Attention

Daily stars & forks

Loading attention chart

Star accumulation

Cumulative stars

Loading star accumulation chart

Pull requests

Daily opens & merges

Loading pull requests chart

Conversations

Daily issues & comments

Loading conversations chart

Community

Daily accounts & reviews

Loading community chart

Releases

Daily releases

Loading releases chart

Mentions

3posts · 30d
Nov 30 posts
  1. Zenn · · @yuukiogino

    VOICEVOX Engine for UE5プラグイン ver2.0 概要 VOICEVOX Engine for UE5プラグインはヒホさんが制作・公開されている、 VOICEVOXの非公式 UnrealEngine5対応版、VOICEVOX COREをUE5で使用するためのプラグインです。 対応プラットフォーム&エンジンバージョン Windows11 macOS UnrealEngine5.0~5.7 VOICEVOX CORE対応バージョン プラグインのバージョンごとに対応するVOICEVOX COREになります。 ver2.x VOICEVOX CORE 0.16.0 ! VOICEVOX NEMO COREは16がリリースされてないため、ver2.x以降は対象外となります。 ver1.x VOICEVOX CORE 0.15.7 VOICEVOX NEMO CORE 0.15.0 プラグイン使用準備 Githubに記載したReadMEを見てください。 基本的な処理フロー VOICEVOX Engine for UE5プラグインの基本的な利用フローは次のとおりです。 C++ C++ から利用する手順を説明します。 各ヘッダーファイルについて プラグインに作成した各ヘッダーファイルの説明です。 cppファイルも公開しているので、セットで見てください。 VoicevoxUECore UVoicevoxCoreSubsystem.h VOICEVOX COREのAPIへ接続するためのSubsystemです。 C++で利用する場合はUVoicevoxCoreSubsystemから各VOICEVOX CORE APIを呼ぶことを想定しています。 EngineSubystemの派生クラスです。 EditorとGame両方で使用する想定 VoicevoxEngine VoicevoxBlueprintLibrary.h VOICE VOX COREのAPIを実行するBlueprint公開用ノードをまとめています。 VoicevoxAsyncTask.h VOICE VOX COREのAPIを実行するBlueprint公開用ノードをまとめています。 負荷がかかる一部のAPIをLatentノードにしています。 全体の呼び出し順序 Build.cs に依存モジュールを追加する Build.csのPublicDependencyModuleNames、もしくはPrivateDependencyModuleNamesに以下のモジュール名を追加してください。 C++のみ VoicevoxUECore Blueprint、もしくはEditorを使用 VoicevoxUECore VoicevoxEngine PublicDependencyModuleNames.AddRange( new string[] { "Core", "InputCore", "CoreUObject", "Engine" } ); PrivateDependencyModuleNames.AddRange( new string[] { "VoicevoxUECore", "VoicevoxEngine", } C++で実装 UE側はUVoicevoxCoreSubsystemを用いて実装します。 以下、ゲーム側実装例になります。 VOICEVOX COREの初期化 最初にVOICEVOX COREの初期化APIを必ず実行してください。 ゲーム側の利用例は次のとおりです。 #include "Engine/Engine.h" #include "Subsystems/VoicevoxCoreSubsystem.h" void InitializeVoicevoxExample() { if (!GEngine) { return; } UVoicevoxCoreSubsystem* Core = GEngine->GetEngineSubsystem<UVoicevoxCoreSubsystem>(); if (!Core) { return; } // CPU モードで初期化。全モデル一括読み込みは要求しない。 const bool bInitialized = Core->Initialize(false, 0, false); if (!bInitialized) { UE_LOG(LogTemp, Error, TEXT("VOICEVOX initialization failed")); return; } // vvmファイル名を渡してモデルデータを読み込む const FString ModelPath = TEXT("0"); if (!Core->LoadVoiceModel(ModelPath)) { UE_LOG(LogTemp, Error, TEXT("VOICEVOX model load failed")); return; } } 初期化・モデル読み込みは時間がかかる可能性があるため、上記はAPIの呼び出し順序を示す最小例です。 ! ゲームのメインスレッドで実行することを推奨しません。 実際にはロード画面やワーカースレッド、非同期タスクなどでAPIを実行してください。 テキストから WAV データを生成する RunTextToSpeech() は WAV 形式のバイト配列 TArray<uint8> を返します。 スタイルIDはロードしたVVMファイルから利用可能なIDを指定してください。 #include "Engine/Engine.h" #include "Subsystems/VoicevoxCoreSubsystem.h" TArray<uint8> GenerateVoicevoxWavExample() { if (!GEngine) { return {}; } const UVoicevoxCoreSubsystem* Core = GEngine->GetEngineSubsystem<UVoicevoxCoreSubsystem>(); if (!Core || !Core->GetIsInitialize()) { return {}; } const VoicevoxStyleId StyleId = 0; // 実際に利用可能なスタイルIDを指定 return Core->RunTextToSpeech( StyleId, TEXT("こんにちは、Unreal Engine から音声を合成しています。"), false, // 通常テキスト true // 疑問文の調整を有効化 ); } 戻り値はWAV のバイト列です。 USoundWaveで再生する場合は変換処理が必要です。 ! 合成処理をゲームのメインスレッドで実行することを推奨しません。 実際にはワーカースレッド、もしくは非同期タスクなどでAPIを実行してください。 AudioQuery を編集して合成する 音声のパラメータを調整したい場合は、まず GetAudioQuery() でAudioQueryを取得し、編集後に RunSynthesis() に渡します。 #include "Engine/Engine.h" #include "Subsystems/VoicevoxCoreSubsystem.h" TArray<uint8> GenerateFromQueryExample() { if (!GEngine) { return {}; } const UVoicevoxCoreSubsystem* Core = GEngine->GetEngineSubsystem<UVoicevoxCoreSubsystem>(); if (!Core || !Core->GetIsInitialize()) { return {}; } const VoicevoxStyleId StyleId = 0; FVoicevoxAudioQuery Query = Core->GetAudioQuery( StyleId, TEXT("音声合成のテストです。"), false); // 必要に応じて Query の各パラメータを変更する。 return Core->RunSynthesis(Query, StyleId, true); } 終了処理 VOICEVOX CORE を利用しなくなったときはFinalize() を呼び出します。 if (GEngine) { if (UVoicevoxCoreSubsystem* Core = GEngine->GetEngineSubsystem<UVoicevoxCoreSubsystem>()) { Core->Finalize(); } } UVoicevoxCoreSubsystem API一覧 UVoicevoxCoreSubsystemで公開されているAPI一覧です。 ライフサイクル・初期化 API宣言 説明 bool Initialize(bool bUseGPU, int CPUNumThreads = 0, bool bLoadAllModels = false); VOICEVOX COREの初期化 bool GetIsInitialize() const; 初期化処理実行済みかを取得 void Finalize(); VOICEVOX COREの終了処理 モデル管理 API宣言 説明 bool LoadModel(VoicevoxStyleId StyleId) const; スタイルIDでモデルをロード(旧APIを残しています。実際はLoadVoiceModelを使用してください) bool LoadVoiceModel(const FString& VvmFileName) const; 指定VVMファイルをロード bool AllLoadVoiceModel() const; 全VVMファイルをロード bool UnloadVoiceModel(const FString& VvmFileName) const; 指定VVMファイルをアンロード bool IsLoadedVoiceModel(const FString& VvmFileName) const; 指定VVMファイルのロード状態を確認 テキスト解析・AudioQuery API宣言 説明 TArray<FVoicevoxAccentPhrase> OpenJTalkRcAnalyze(const FString& Text) const; 日本語テキストをアクセント句へ解析 FVoicevoxAudioQuery GetAudioQuery(VoicevoxStyleId StyleId, const FString& Message, bool bKana) const; テキストからAudioQueryを生成 FVoicevoxAudioQuery GetAudioQueryFromAccentPhrases(const TArray<FVoicevoxAccentPhrase>& AccentPhrases) const; アクセント句からAudioQueryを生成 TArray<FVoicevoxAccentPhrase> SynthesizerCreateAccentPhrases(VoicevoxStyleId StyleId, const FString& Text, bool bKana) const; スタイル指定でアクセント句を生成 TArray<FVoicevoxAccentPhrase> SynthesizerReplace(EReplaceType ReplaceType, const TArray<FVoicevoxAccentPhrase>& AccentPhrases, VoicevoxStyleId StyleId) const; アクセント句の指定パラメータを再生成 音声合成 API宣言 説明 TArray<uint8> RunTextToSpeech(VoicevoxStyleId StyleId, const FString& Message, bool bKana, bool bEnableInterrogativeUpspeak) const; テキストからWAVバイト列を生成 TArray<uint8> RunSynthesis(const char* AudioQueryJson, VoicevoxStyleId StyleId, bool bEnableInterrogativeUpspeak) const; AudioQueryまたはアセットからWAVバイト列を生成 TArray<uint8> RunSynthesis(const FVoicevoxAudioQuery& AudioQuery, VoicevoxStyleId StyleId, bool bEnableInterrogativeUpspeak) const; AudioQueryまたはアセットからWAVバイト列を生成 TArray<uint8> RunSynthesis(const UVoicevoxQuery& VoicevoxQuery, bool bEnableInterrogativeUpspeak) const; AudioQueryまたはアセットからWAVバイト列を生成 リップシンク API宣言 説明 static TArray<FVoicevoxLipSync> GetLipSyncList(FVoicevoxAudioQuery AudioQuery, bool bIsSimple = false, float PitchModulation = 1.0f); AudioQueryからリップシンクデータを生成 メタ情報・実行環境 API宣言 説明 TArray<FVoicevoxMeta> GetMetaList() const; 話者メタ情報を取得 TArray<FVoicevoxMeta> GetVoiceModelFileMetaList(const FString& VvmFileName) const; 指定VVMのメタ情報を取得 TArray<FVoicevoxMeta> GetAllVoiceModelFileMetaList() const; 全VVMのメタ情報を取得 FString GetMetaName(VoicevoxStyleId StyleId) const; スタイルIDに対応する名前を取得 TMap<int, FString> GetVvmFileNameMapToStyleId() const; スタイルIDからVVM名への対応表を取得 FString GetVoicevoxVersion(const FString& CoreName); 指定COREのバージョン取得 bool IsGpuMode(const FString& CoreName); 指定COREのGPUモードを確認 FVoicevoxSupportedDevices GetSupportedDevices(const FString& CoreName); 指定COREの対応デバイス取得 TArray<FString> GetCoreNameList(); 初期化済みCORE名一覧を取得 ユーザー辞書 API宣言 説明 VoicevoxUserDictWord UserDictWordMake(const FString& Surface, const FString& Pronunciation, uintptr_t AccentType) const; 辞書単語の構造体を生成 bool UserDictInitialize(const FString& DictPath = TEXT("")) const; ユーザー辞書を初期化 TArray<uint8_t> UserDictAddWord(const VoicevoxUserDictWord* Word) const; 辞書単語を追加しUUIDを返す bool RewriteUserDictWord(const TArray<uint8_t>& WordUuid, const VoicevoxUserDictWord *Word) const; 辞書単語を更新 bool DeleteUserDictWord(const TArray<uint8_t>& WordUuid) const; 辞書単語を削除 TMap<FString, FVoicevoxRegisteredUserDictWord> GetUserDictWord() const; 登録済み辞書単語を取得 bool UserDictSave(const FString& Path) const; 辞書をファイルに保存 void UserDictDelete() const; 辞書を破棄 Blueprint Blueprint から利用する手順を説明します。 Blueprint での利用フロー 処理フローの例です。 実際にゲームへ組み込む際は、次の順序を基本にします。 VOICEVOX CORE を初期化する。 必要な音声モデルをロードする。 TextToSpeechOutput() などで音声を生成する。 戻り値の USoundWave が有効なら再生する。 必要なら AudioQuery からリップシンク情報を生成し、対応する Audio Component に渡す。 終了時に CORE のリソースを解放する。 Blueprint API 同期APIと状態参照・辞書操作 Blueprintノード名 公開種別 C++宣言 VoicevoxFinalize BlueprintCallable static void Finalize() GetOpenJTalkRcAnalyze BlueprintCallable static UPARAM(DisplayName="OpenJTalkAnalyze") TArray<FVoicevoxAccentPhrase> OpenJTalkRcAnalyze(const FString& Text) VoicevoxUnLoadVoiceModel BlueprintCallable static bool UnloadVoiceModel(FString VvmFileName) VoicevoxIsLoadedVoiceModel BlueprintCallable static bool IsLoadedVoiceModel(FString VvmFileName) GetVoicevoxCoreNameList BlueprintPure static UPARAM(DisplayName="CoreNameList") TArray<FString> GetCoreNameList() GetVoicevoxMetas BlueprintPure static UPARAM(DisplayName="Metas") TArray<FVoicevoxMeta> GetMetasToList() GetVoicevoxModelFileMetas BlueprintPure static UPARAM(DisplayName="Metas") TArray<FVoicevoxMeta> GetVoiceModelFileMetaList(const FString& VvmFileName) GetAllVoicevoxModelFileMetas BlueprintCallable static UPARAM(DisplayName="Metas") TArray<FVoicevoxMeta> GetAllVoiceModelFileMetaList() GetVoicevoxSupportedDevices BlueprintPure static UPARAM(DisplayName="SupportedDevices") FVoicevoxSupportedDevices GetSupportedDevices(const FString& CoreName) VoicevoxVersion BlueprintPure static UPARAM(DisplayName="VoicevoxCoreVersion") FString GetVoicevoxCoreVersion(const FString& CoreName) IsVoicevoxGpuMode BlueprintPure static UPARAM(DisplayName="GPU Mode") bool IsVoicevoxGpuMode(const FString& CoreName) VoicevoxTextToSpeechOutput BlueprintCallable static UPARAM(DisplayName="Sound") USoundWave* TextToSpeechOutput(int32 StyleId, FString Message, bool bRunKana = false, bool bEnableInterrogativeUpspeak = true) VoicevoxToTextAudioQueryOutput BlueprintCallable static UPARAM(DisplayName="Sound") USoundWave* TextToAudioQueryOutput(int32 StyleId, FString Message, bool bRunKana = false, bool bEnableInterrogativeUpspeak = true) GetVoicevoxAudioQuery BlueprintCallable static UPARAM(DisplayName="AudioQuery") FVoicevoxAudioQuery GetAudioQuery(int32 StyleId, FString Message, bool bRunKana = false) GetVoicevoxAudioQueryFromAccentPhrases BlueprintCallable static UPARAM(DisplayName="AudioQuery") FVoicevoxAudioQuery GetAudioQueryFromAccentPhrases(const TArray<FVoicevoxAccentPhrase>& AccentPhrases) GetVoicevoxAccentPhrase BlueprintCallable static UPARAM(DisplayName="AccentPhraseAnalyze") TArray<FVoicevoxAccentPhrase> GetSynthesizerAccentPhrase(int32 StyleId, const FString& Text, bool bKana) VoicevoxReplace BlueprintCallable static UPARAM(DisplayName="AccentPhraseAnalyze") TArray<FVoicevoxAccentPhrase> SynthesizerReplace(EReplaceType ReplaceType, const TArray<FVoicevoxAccentPhrase>& AccentPhrases, int32 StyleId) VoicevoxAudioQueryOutput BlueprintCallable static UPARAM(DisplayName="Sound") USoundWave* AudioQueryOutput(FVoicevoxAudioQuery AudioQuery, int32 StyleId, bool bEnableInterrogativeUpspeak = true) VoicevoxQueryAssetOutput BlueprintCallable static UPARAM(DisplayName="Sound") USoundWave* VoicevoxQueryOutput(UVoicevoxQuery* VoicevoxQuery, bool bEnableInterrogativeUpspeak = true) GetVoicevoxLipSyncList BlueprintCallable static UPARAM(DisplayName="LipSyncList") TArray<FVoicevoxLipSync> GetLipSyncList(FVoicevoxAudioQuery AudioQuery) VoicevoxUserDictWordMake BlueprintCallable static UPARAM(DisplayName="UserDictWord") FVoicevoxCoreUserDictWord UserDictWordMake(const FString& Surface, const FString& Pronunciation, int64 AccentType) VoicevoxCoreUserDictInitialize BlueprintCallable static bool UserDictInitialize(const FString& DictPath = TEXT("")) VoicevoxUserDictAddWord BlueprintCallable static UPARAM(DisplayName="UUID") TArray<uint8> UserDictAddWord(const FVoicevoxCoreUserDictWord Word) VoicevoxRewriteUserDictWord BlueprintCallable static bool RewriteUserDictWord(const TArray<uint8>& WordUuid, const FVoicevoxCoreUserDictWord Word) VoicevoxDeleteUserDictWord BlueprintCallable static bool DeleteUserDictWord(const TArray<uint8>& WordUuid) GetVoicevoxUserDictWord BlueprintCallable static TMap<FString, FVoicevoxRegisteredUserDictWord> GetUserDictWord() VoicevoxCoreUserDictSave BlueprintCallable static bool UserDictSave(const FString& Path) VoicevoxCoreUserDictDelete BlueprintCallable static void UserDictDelete() 非同期アクションノード Blueprintノード名 公開種別 C++宣言 VoicevoxInitialize BlueprintCallable static UVoicevoxInitializeAsyncTask* Initialize(UObject* WorldContextObject, bool bUseGPU, int CPUNumThreads = 0) VoicevoxLoadModel BlueprintCallable static UVoicevoxLoadModelAsyncTask* LoadModel(UObject* WorldContextObject, int32 StyleId) VoicevoxLoadVoiceModel BlueprintCallable static UVoicevoxLoadVoiceModelAsyncTask* LoadVoiceModel(UObject* WorldContextObject, FString VvmFileName) VoicevoxAllLoadVoiceModel BlueprintCallable static UVoicevoxLoadVoiceModelAsyncTask* AllLoadVoiceModel(UObject* WorldContextObject) VoicevoxTextToSpeechOutputAsync BlueprintCallable static UVoicevoxTextToSpeechAsyncTask* TextToSpeech(UObject* WorldContextObject, int32 StyleId, FString Message, bool bRunKana = false, bool bEnableInterrogativeUpspeak = true) VoicevoxToTextAudioQueryOutputAsync BlueprintCallable static UVoicevoxTextToSpeechAsyncTask* TextToAudioQuery(UObject* WorldContextObject, int32 StyleId, FString Message, bool bRunKana = false, bool bEnableInterrogativeUpspeak = true) VoicevoxAudioQueryOutputAsync BlueprintCallable static UVoicevoxAudioQueryToSpeechAsyncTask* AudioQueryOutput(UObject* WorldContextObject, int32 StyleId, FVoicevoxAudioQuery AudioQuery, bool bEnableInterrogativeUpspeak = true) VoicevoxQueryAssetOutputAsync BlueprintCallable static UVoicevoxAudioQueryToSpeechAsyncTask* VoicevoxQueryOutput(UObject* WorldContextObject, UVoicevoxQuery* VoicevoxQuery, bool bEnableInterrogativeUpspeak = true) リップシンク付き音声再生コンポーネント Blueprintノード名 公開種別 C++宣言 StopAudioAndLipSync BlueprintCallable void StopAudioAndLipSync() PlayToText BlueprintCallable void PlayToText(FString Message, bool bRunKana = false, bool bEnableInterrogativeUpspeak = true, float SpeedScale = 1.0f, float PitchScale = 0.0f, float IntonationScale = 1.0f, float VolumeScale = 1.0f, float PrePhonemeLength = 0.1f, float PostPhonemeLength = 0.1f) PlayToAudioQuery BlueprintCallable void PlayToAudioQuery(const FVoicevoxAudioQuery& Query, bool bEnableInterrogativeUpspeak = true) PlayToAudioQueryAsset BlueprintCallable void PlayToAudioQueryAsset(UVoicevoxQuery* VoicevoxQuery, bool bEnableInterrogativeUpspeak = true) SetLipSyncDataToAudioQuery BlueprintCallable void SetLipSyncDataToAudioQuery(const FVoicevoxAudioQuery& Query) SetLipSyncDataToAudioQueryAsset BlueprintCallable void SetLipSyncDataToAudioQueryAsset(UVoicevoxQuery* VoicevoxQuery) VoicecoxCharacterLipSyncAudioComponent キャラクターのSkeletalMesh設定 Blueprintノード名 公開種別 C++宣言 SetSkeletalMesh BlueprintCallable void SetSkeletalMesh(USkeletalMeshComponent* SkeletalMesh) リップシンク 以下の記事を見てください。 VoicevoxEngine For UE リップシンクコンポーネント エディタ拡張 VoicevoxEngineプラグインが有効な場合、メニューバーにVOICEVOXメニューが追加されます。 Editor ! エディターはα版となります。 アクセント情報を作成、編集するエディター機能です。 保存でVoicevox AudioQueryアセットを生成、アセット書き出しでSoundWaveアセット、音声書き出しでWavファイルを作成します。 アクセント、イントネーション、長さの編集は未対応です。 もし編集したい場合は、一度Voicevox AudioQueryアセットを生成後、AccentPhaasesの項目を編集してください。 Speaker List プラグインで利用可能なVOICEVOX モデルの一覧です。 Copyボタンを押すことで、style IDをコピーします。 利用時の注意点 初期化とモデル読み込みは音声合成より先に行う。 Initialize() の成功だけでは目的のスタイルのモデルが読み込まれているとは限りません。 重い処理をゲームスレッドに直書きしない。 初期化、モデル読み込み、AudioQuery 生成、合成は負荷を考慮し、適切な非同期実行を設計してください。 スタイルIDを確認する。 読み込んだVVMファイルに格納されているスタイルIDのみ利用可能です。 AquesTalkライクな記法をする場合はルールに従う。 AquesTalkライクな記法をする場合、ルールに違反するとクラッシュします。 例:ボク'ワ/ズ'ンダモン/ナノ'ダ 全てのカナはカタカナで記述される アクセント句は/または、で区切る。、で区切った場合に限り無音区間が挿入される。 カナの手前に_を入れるとそのカナは無声化される アクセント位置を'で指定する。全てのアクセント句にはアクセント位置を 1 つ指定する必要がある。 アクセント句末に?(全角)を入れることにより疑問文の発音ができる ※VOICEVOX ENGINE ReadMeより引用 ライセンス VOICEVOX ENGINEのライセンスを継承し、LGPL v3と、ソースコードの公開が不要な別ライセンスのデュアルライセンスとなります。 利用規約 VOICEVOX Engine for UE5の利用規約はVOICEVOXのホームページに記載された利用規約を継承するため、利用前に必ず一読してください。 各スピーカーモデルのライセンスはVOICEVOX公式ホームページのキャラクター一覧を参照してください。 ! VOCEVOXの利用規約及び各キャラクターの利用規約を厳守するようにお願いいたします 問い合わせに関して VOICEVOX Engine for UE5プラグインに関して質問があれば、Twitter、Qiitaのコメント欄で聞いてもらうか、公開したGithubのissueに記載してください。 ! 間違ってもVOICEVOX CORE作者のヒホさん、VOICEVOX公式Twitterアカウント及びVOICEVOX ホームページで、VOICEVOX Engine for UE5プラグインの問い合わせをしないようにお願いいたします。

  2. 🎉 #VOICEVOX 音声合成コアがストリーミングトークに対応しました! 音声を合成しながら再生する機能をプログラムへ導入できます。 C API、Python、Rust、iOS、Android用のライブラリをご用意しています。 ▼ Key Changes github.com/VOICEVOX/voicevox_core/blob/main/docs/… ▼ サンプルコード t.co

    242 likes · 77 reposts · 7,489 views
  3. X · · @kenhys

    voicevox_core でMIGraphXをサポートしてみる実験 voicevox_core#1459

    1 like · 67 views

Latest stargazers

The last 10 distinct accounts we observed this year.

Most active participants

PR, issue, comment & review events in the past year.

Packages

10
PackageVersionDownloads · 30dTrend · 30d
v0.2.8——
test_utilv0.1.0
v0.1.0——
———
———
———
———
———
———
xtaskv0.1.4
v0.1.4——
———

README badges

Embed a badge in your README or website.

Live mentions · last 30 days
VOICEVOX/voicevox_core mentions in the last 30 days