A wrapper library and integration IPC server of the CeVIO API for .NET 7 / .NET Standard 2.0
音声合成ソフト「CeVIO」の .NET外部連携インターフェイスを 最新の .NET 7等からも扱えるようにしたラッパーライブラリ&連携サーバーです。.NET Framework 4.8以外むけの.NETアプリから利用できるようになります。また、async/await, ValueTask, nullableなどモダンな書き方に対応しています。
A wrapper library and integration IPC server for the .NET external integration interface of the speech synthesis software "CeVIO", which can be used from the latest .NET 7 and other .NET Framework 4.8 environments. It also supports modern C# writing style such as async/await, ValueTask, nullable, and so on.
async / awaitnullableValueTask<T>.unitypackage を用意しています.nupkg.unitypackagedotnet add package FluentCeVIOWrapper.Common//ファクトリメソッドで非同期生成
//IDisposableを継承しているためusingが使えます
using var fcw = await FluentCeVIO.FactoryAsync();
//非同期でCeVIO外部連携インターフェイス起動
await fcw.StartAsync();
//利用可能なキャスト(ボイス)を非同期で取得
var casts = await fcw.GetAvailableCastsAsync();
//感情一覧を非同期で取得
var emotes = await fcw.GetComponentsAsync();
var newEmo = emotes
.Select(v => {
v.Value = (v.Name == "哀しみ") ?
(uint)100 :
(uint)0;
return v;
})
.ToList();
//メソッドチェーンでまとめてパラメータ指定
await fcw.CreateParam()
.Cast(casts[0])
.Alpha(30)
.Speed(50)
.ToneScale(75)
.Components(newEmo)
.SendAsync();
//非同期で音声合成
await fcw.SpeakAsync("こんにちは。");
//感情設定は Emotions() で簡単にできる
await fcw.CreateParam()
//キャスト名の直接指定でも実はOK
.Cast("さとうささら")
//感情一覧を取得しなくても使える便利関数
//感情名が一致すれば設定します。存在しない場合は無視
.Emotions(new()
{
["元気"] = 0,
["哀しみ"] = 0,
["怒り"] = 75,
["普通"] = 50
})
.SendAsync();
await fcw.SpeakAsync("こんにちは!!");| CeVIO class | CeVIO name | FCW class | FCW name |
|---|---|---|---|
| - | - | FluentCeVIOUtil | GetCastIdAsync() |
| Talker/Talker2 | Alpha | FluentCeVIO | GetAlphaAsync() / SetAlphaAsync() |
| Talker/Talker2 | Alpha | FluentCeVIOParam | Alpha() |
| Talker/Talker2 | AvailableCasts | FluentCeVIO | GetAvailableCastsAsync() |
| Talker/Talker2 | Cast | FluentCeVIO | GetCastAsync() / SetCastAsync() |
| Talker/Talker2 | Cast | FluentCeVIOParam | Cast() |
| ServiceControl /ServiceControl2 | CloseHost() | FluentCeVIO | CloseAsync() |
| Talker/Talker2 | Components | FluentCeVIO | GetComponentsAsync() / SetComponentsAsync() |
| Talker/Talker2 | Components | FluentCeVIOParam | Components() |
| Talker/Talker2 | Components | FluentCeVIOParam | Emotions() |
| Talker/Talker2 | GetPhonemes() | FluentCeVIO | GetPhonemesAsync() |
| Talker/Talker2 | GetTextDuration() | FluentCeVIO | GetTextDurationAsync() |
| ServiceControl /ServiceControl2 | HostVersion | FluentCeVIO | GetHostVersionAsync() |
| ServiceControl /ServiceControl2 | IsHostStarted | FluentCeVIO | GetIsHostStartedAsync() |
| Talker/Talker2 | OutputWaveToFile() | FluentCeVIO | OutputWaveToFileAsync() |
| Talker/Talker2 | Speak() | FluentCeVIO | SpeakAsync() |
| Talker/Talker2 | Speak() | FluentCeVIOParam | SendAndSpeakAsync() |
| Talker/Talker2 | Speed | FluentCeVIO | GetSpeedAsync() / SetSpeedAsync() |
| Talker/Talker2 | Speed | FluentCeVIOParam | Speed() |
| ServiceControl /ServiceControl2 | StartHost() | FluentCeVIO | StartAsync() |
| Talker/Talker2 | Stop() | FluentCeVIO | StopAsync() |
| Talker/Talker2 | Tone | FluentCeVIO | GetToneAsync() / SetToneAsync() |
| Talker/Talker2 | Tone | FluentCeVIOParam | Tone() |
| Talker/Talker2 | ToneScale | FluentCeVIO | GetToneScaleAsync() / SetToneScaleAsync() |
| Talker/Talker2 | ToneScale | FluentCeVIOParam | ToneScale() |
| Talker/Talker2 | Volume | FluentCeVIO | GetVolumeAsync() / SetVolumeAsync() |
| Talker/Talker2 | Volume | FluentCeVIOParam | Volume() |
Process.Start()などで外部プロセス呼び出しFluentCeVIOWrapper.Common.FluentCeVIOクラスで通信が可能です-help : ヘルプ表示-cevio : CeVIO_AI or CeVIO_CS-pipeName : IPCで使われる名前付きパイプ名。複数起動時に設定します。-dllPath : CeVIOのインストールフォルダパス指定CeVIO AIとCeVIO Creative Studioに同時に通信する場合、サーバーを2つ立ち上げてください。
unitypackageをReleasesからDLして取り込むだけです。
see README
Assets/Init.csは実際の呼び出しスクリプトです。
さとうささら)は所持済みのボイスライブラリ名に書き換えてください
MIT License
Copyright (c) 2022 - 2023 いぬいぬ
See detail LICENSE