Giter Club home page Giter Club logo

kotoha's Introduction

Kotoha

license

Kotoha is a .NET library that provides a common API for operations such as VOICEROID2.

Usage

Very simple.

using (var player = new KotohaPlayer())
{
    player.LoadPlugins($@"{Environment.CurrentDirectory}/plugins", recursive: true);
    player.Initialize();

    await player.SpeechAsync("こんにちは", "琴葉 葵");
}

For more information, please see Sample Project.

Plugins

Engine

Engine is UI automation / API call implementation for Text-To-Speech engines.
For example:

  • Engine provides Web API / COM / DLL library -> You should implement API call for Kotoha.
  • Engine doesn't provide APIs, but it has GUI -> You should implement UI automation for Kotoha.

Kotoha use Codeer.Friendly for UI automation. You can use and find it in Kotoha.Plugin.Automation namespace classes.

Example implementation is Kotoha.Engine.Voiceroid2.

Lifecycle

All plugins are loaded when LoadPlugins is called by Application Host.
But, Kotoha doesn't launch/find backend engines (e.g. VOICEROID, CeVIO).

    +-----------+-----------+
    |     LoadPlugins()     |
    +-----------+-----------+
                |
    +-----------+-----------+
    |     constructor()     |
    +-----------+-----------+
                +<------------------------------------------------------------------------------------+
    +-----------+-----------+                                                                         |
    | SpeechAsync(str, str) +                                                                         |
    +-----------+-----------+                                                                         |
                |                                                                                     |
                |                       +-----------+-----------+                                     |
       Already Initialized? ---- No --->+ FindCurrentProcess()  |                                     |
                |                       +-----------+-----------+                                     |
               Yes                                  |                     +-----------------------+   |
                |                           Already Launched? ---- No --->+  FindMainExecutable() |   |
                |                                   |                     +-----------+-----------+   |
                |                                  Yes                                |               |
                |                                   |                                 |               |
                |                       +-----------+-----------+                     |               |
                |                       |   Initialize(IntPtr)  +<--------------------+               |
                |                       +-----------+-----------+                                     |
                |                                   |                                                 |
                +<----------------------------------+                                                 |
                |                                                                                     |
    +-----------+-----------+                                                                         |
    | SpeechAsync(str,talk) +-------------------------------------------------------------------------+
    +-----------+-----------+
                |
    +-----------+-----------+
    |       Dispose()       |
    +-----------+-----------+             

Talkers

You can choose 3-type plugin of talker.

  1. .NET library.
  2. JSON configuration.
  3. Class that implement IKotohaTalker.

Plugins offer the same thing.

  • name : Plugin name that you like. You may need to follow the engine.
  • engine : Text-To-Speech engine name such as VOICEROID2, CeVIO...

.NET library

  1. Create a new project as .NET Desktop library.
  2. Set reference to Kotoha.Plugin.
  3. Implement IKotohaTalker interface.
  4. Build

JSON configuration

You write JSON as below example.

[
  {
    "name": "琴葉 茜",
    "engine": "VOICEROID2"
  },
  {
    "name": "琴葉 葵",
    "engine": "VOICEROID2"
  }
]

and load.

player.LoadConfigs("/path/to/talkers_configuration.json");

Class

Create a new class

internal class Yukari : IKotohaTalker
{
    public string Name => "結月ゆかり";
    public string Engine => "VOICEROID2";
}

and load

player.LoadClasses(new List<IKotohaTalker> { new Yukari() });

Donation

If you want to support me, you can donate cryptocurrencies here.
https://mochizuki.moe/donation

kotoha's People

Contributors

mika-f avatar

Stargazers

 avatar

Watchers

 avatar

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.