Aivis.Net 1.2.0

dotnet add package Aivis.Net --version 1.2.0
                    
NuGet\Install-Package Aivis.Net -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aivis.Net" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aivis.Net" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Aivis.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aivis.Net --version 1.2.0
                    
#r "nuget: Aivis.Net, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aivis.Net@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aivis.Net&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Aivis.Net&version=1.2.0
                    
Install as a Cake Tool

Aivis.NET

Aivis APIの非公式C#ライブラリです。Text-to-Speech(音声合成)機能を提供します。

インストール

dotnet add package Aivis.Net

クイックスタート

using Aivis;

// APIキーでクライアントを初期化
var options = new AivisClientOptions("your-api-key");
var client = new AivisTTSClient(options);

// テキストを音声に変換
using var audioStream = await client.SynthesizeStreamAsync("model-uuid", "こんにちは、世界!");

// 音声を再生
Aivis.Speakers.MP3Speaker speaker = new ();
await speaker.PlayAsync(audioStream);
speaker.Dispose();

機能

  • ✅ Aivis APIを使用したテキスト音声合成
  • ✅ FFmpegとOpenALによる音声再生サポート
  • ✅ レスポンスメタデータ(課金情報、文字数、レート制限など)
  • ✅ .NET6 ~ .NET9をサポート
  • ✅ async/awaitパターン

使用方法

基本的なTTS

var options = new AivisClientOptions("your-api-key");
var client = new AivisTTSClient(options);

// 音声ストリームのみを取得
using var audioStream = await client.SynthesizeStreamAsync("model-uuid", "こんにちは、世界!");

// 音声とメタデータを取得
var contents = await client.SynthesizeWithContentsAsync("model-uuid", "ここにテキストを入力");
Console.WriteLine($"文字数: {contents.CharacterCount}");
Console.WriteLine($"使用クレジット: {contents.CreditsUsed}");

音声再生

FFmpegとOpenALがインストールされている必要があります。

Aivis.Speakers.MP3Speaker speaker = new ();
await speaker.PlayAsync(contents.AudioStream);
speaker.Dispose();

依存関係

  • OpenTK 4.9.4(音声再生用)

リンク

ライセンス

© 2025 Ryota Uchiyama


Aivis.NET (English)

An unofficial C# library for the Aivis API, providing Text-to-Speech functionality.

Installation

dotnet add package Aivis.Net

Quick Start

using Aivis;

// Initialize client with your API key
var options = new AivisClientOptions("your-api-key");
var client = new AivisTTSClient(options);

// Synthesize text to speech
using var audioStream = await client.SynthesizeStreamAsync("model-uuid", "こんにちは、世界!");

// Play audio
Aivis.Speakers.MP3Speaker speaker = new ();
await speaker.PlayAsync(audioStream);
speaker.Dispose();

Features

  • ✅ Text-to-Speech synthesis via Aivis API
  • ✅ Audio playback support with FFmpeg and OpenAL
  • ✅ Response metadata (billing, character count, rate limits)
  • ✅ Support between .NET 6.0 and .NET 9.0
  • ✅ Async/await pattern

Usage

Basic TTS

var options = new AivisClientOptions("your-api-key");
var client = new AivisTTSClient(options);

// Get audio stream only
using var audioStream = await client.SynthesizeStreamAsync("model-uuid", "こんにちは、世界!");

// Get audio with metadata
var contents = await client.SynthesizeWithContentsAsync("model-uuid", "Your text here");
Console.WriteLine($"Character Count: {contents.CharacterCount}");
Console.WriteLine($"Credits Used: {contents.CreditsUsed}");

Audio Playback

Need install to FFmpeg and OpenAL.

Aivis.Speakers.MP3Speaker speaker = new ();
await speaker.PlayAsync(contents.AudioStream);
speaker.Dispose();

Dependencies

  • OpenTK 4.9.4 (for audio playback)

License

© 2025 Ryota Uchiyama

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 60 9/6/2025
1.1.0 129 8/18/2025
1.0.0 58 8/16/2025
0.5.2 60 8/16/2025
0.5.1 59 8/16/2025
0.5.0 129 8/15/2025
0.4.0 208 8/7/2025
0.3.0 23 8/2/2025
0.2.1 25 8/2/2025
0.2.0 95 7/31/2025
0.1.2 95 7/31/2025
0.1.1 95 7/30/2025
0.1.0 96 7/30/2025

1.2.0 - 2025-09-07
         1. 変更
         - Text To Speechのオプションで早さやテンポを設定できるようにしました。

         1.1.0 - 2025-08-19
         1. アップグレード
         - .NET6.0以降に対応しました。

         1.0.0 - 2025-08-17
         1. 変更
         - TextToSpeechのときにオプションを設定できるようにしました。

         0.5.2 - 2025-08-16
         1. 追加
         - ドキュメンテーションを追加しました。

         0.5.1 - 2025-08-16
         1. 追加
         Nugetパッケージ情報を修正しました。

         0.5.0 - 2025-08-15
         1. 追加
         - `FFmpeg`と`OpenAL`を使用した音声再生の仕組みを追加しました

         2. 変更
         - `TTSContents`の`audio`を`Stream audioStream`に変更しました

         3. 破壊的変更
         - NAudioを利用したSpeaker機能は廃止しました
           - NAudioを利用する場合はサンプルアプリを参照してください
         - `TextToSpeech`で`byte[]`を戻り値とするメソッドを廃止しました
           - `Stream`を返す機能で利用してください