Aivis.Net
1.2.0
dotnet add package Aivis.Net --version 1.2.0
NuGet\Install-Package Aivis.Net -Version 1.2.0
<PackageReference Include="Aivis.Net" Version="1.2.0" />
<PackageVersion Include="Aivis.Net" Version="1.2.0" />
<PackageReference Include="Aivis.Net" />
paket add Aivis.Net --version 1.2.0
#r "nuget: Aivis.Net, 1.2.0"
#:package Aivis.Net@1.2.0
#addin nuget:?package=Aivis.Net&version=1.2.0
#tool nuget:?package=Aivis.Net&version=1.2.0
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)
Links
License
© 2025 Ryota Uchiyama
Product | Versions 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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`を返す機能で利用してください