Code Monkey home page Code Monkey logo

fluentceviowrapper's Introduction

Fluent CeVIO Wrapper

MIT License C Sharp 10 .NET Standard 2.0 .NET Framework 4.8 Unity 2021.3 GitHub release (latest SemVer including pre-releases) CeVIO CS CeVIO AI

A wrapper library and integration IPC server of the CeVIO API for .NET 7 / .NET Standard 2.0

What's this?

音声合成ソフト「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.

特徴 / Features

  • CeVIO AI, CeVIO Creative Studio 7 対応
  • 共通ライブラリAPIはモダンな記法が可能
    • async / await
    • nullable
    • ValueTask<T>
    • C# 10
  • nuget経由での導入
    • No more GAC、nupkg形式での提供
    • 現在はローカルnugetの想定です
  • 共通ライブラリは .NET Standard 2.0対応
    • .NET Framework系環境・.NET Core系環境どちらからも利用可能
    • .NET 6 / 7での動作を確認済
  • 連携IPCサーバーは .NET Framework 4.8上で起動
    • 名前付きパイプでのIPCを行います
  • Unity3D対応
    • .unitypackage を用意しています
  • バグだらけ。テスト甘いです。
    • 利用していないAPIはテストされていません

構成

使い方

FluentCeVIOWrapper.Common

  1. nupkgファイルをDL
    1. download from Releases
  2. nupkgをローカルnugetリポジトリに登録
  3. ライブラリとして追加。
    1. 例:dotnet 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("こんにちは!!");

Comparison table with CeVIO .NET API

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()

FluentCeVIOWrapper.Server

  1. exeファイルをDL
    1. download from Releases
  2. Process.Start()などで外部プロセス呼び出し
  3. サーバー起動後はFluentCeVIOWrapper.Common.FluentCeVIOクラスで通信が可能です
  • 起動オプション
    • -help : ヘルプ表示
    • -cevio : CeVIO_AI or CeVIO_CS
    • -pipeName : IPCで使われる名前付きパイプ名。複数起動時に設定します。
    • -dllPath : CeVIOのインストールフォルダパス指定

CeVIO AIとCeVIO Creative Studioに同時に通信する場合、サーバーを2つ立ち上げてください。

FluentCeVIOWrapper.Unity

unitypackageをReleasesからDLして取り込むだけです。

see README

Assets/Init.csは実際の呼び出しスクリプトです。

使用例 / Examples

  • Samples
    • C#10で書かれたサンプルのC#コンソールアプリケーションです
    • キャスト名(さとうささら)は所持済みのボイスライブラリ名に書き換えてください
      • 未所持の場合は動きません
  • KuchiPaku
    • YMM4(ゆっくりムービーメーカー4)むけの「あいうえお口パク(リップシンク)」を生成するツールです。
    • CeVIO API連携ボイスの口パク生成に Fluent CeVIO Wrapper を利用しています
    • このアプリ自体は .NET 6 向けに作られており、.NET Framework 向けであるCeVIOの外部連携インターフェイスをそのままでは利用できません。Fluent CeVIO Wrapper を使用することによりCeVIOを呼び出すことを実現しています。
  • SasaraUtil
    • CeVIOのあれこれを便利するユーティリティアプリ
    • このアプリ自体は.NET 7のAvalonia UIで作られています
    • 下記のボイパロイド機能を移植してUIを付けています
  • LibSasara/Sample/SongToTalk
    • CeVIOソングのCCS/CCSTファイルからCeVIOトークの台詞を並べてボイパロイドするための簡易的なツールです
    • LibSasaraと連携するサンプルにもなっています
  • VRM_AI (fork edition)
    • ChatGPT/Whisper/VRMをつかってAITuberが簡単に作れる VRM_AI をCeVIOに独自対応したfork版です
    • 公式で対応していないボイスの感情表現に対応しています

使用ライブラリ

ライセンス

MIT License

Copyright (c) 2022 - 2023 いぬいぬ

See detail LICENSE

🐶Developed by InuInu

fluentceviowrapper's People

Contributors

inuinu2022 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fluentceviowrapper's Issues

長文を逐次分割読み上げする機能の追加

長文を逐次分割読み上げする機能の追加

文字列の長さ制限があるので長い文章をいい感じに切って読み上げる機能
通常の SpeakAsync() を対応しても良いかも
CSとAIの途中バージョン以降では長さ制限が違うので動的に対処
形態素解析処理を入れていい感じに切るといいかも?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.