Lyo.Typecast.Client
1.0.3
See the version list below for details.
dotnet add package Lyo.Typecast.Client --version 1.0.3
NuGet\Install-Package Lyo.Typecast.Client -Version 1.0.3
<PackageReference Include="Lyo.Typecast.Client" Version="1.0.3" />
<PackageVersion Include="Lyo.Typecast.Client" Version="1.0.3" />
<PackageReference Include="Lyo.Typecast.Client" />
paket add Lyo.Typecast.Client --version 1.0.3
#r "nuget: Lyo.Typecast.Client, 1.0.3"
#:package Lyo.Typecast.Client@1.0.3
#addin nuget:?package=Lyo.Typecast.Client&version=1.0.3
#tool nuget:?package=Lyo.Typecast.Client&version=1.0.3
Lyo.Typecast.Client
Typecast API client for text-to-speech and voice management. TypecastClient extends Lyo.Api.Client.ApiClient, configures the X-API-KEY header from TypecastClientOptions, and exposes two managers (TextToSpeech, Voices) for the underlying REST endpoints.
Multi-targets netstandard2.0 and net10.0.
Examples
Register services
// 1. Configuration-bound (defaults to the "TypecastClient" section)
services.AddTypecastClientFromConfiguration(builder.Configuration);
// 2. Inline configuration
services.AddTypecastClient(o => {
o.ApiKey = "your-api-key";
o.BaseUrl = "https://api.typecast.ai";
});
// 3. Pre-built options object
services.AddTypecastClient(new TypecastClientOptions { ApiKey = "your-api-key" });
Register services (2)
{
"TypecastClient": {
"ApiKey": "your-api-key",
"BaseUrl": "https://api.typecast.ai"
}
}
TypecastClient
public readonly TextToSpeechManager TextToSpeech;
public readonly VoiceManager Voices;
Registration
Three DI extensions are available on IServiceCollection: All variants register TypecastClient as a singleton. ILoggerFactory and HttpClient are pulled from the container if available; otherwise sensible defaults are used. Example appsettings.json:
TypecastClientOptions
Extends ApiClientOptions, so it inherits the standard HTTP transport knobs (BaseUrl, timeouts, retry, etc.).
| Property | Notes |
|---|---|
ApiKey |
Required. Sent as X-API-KEY. |
BaseUrl |
Defaults to https://api.typecast.ai. |
SectionName |
"TypecastClient". Used by AddTypecastClientFromConfiguration as the default section. |
JSON is serialized with snake_case naming, case-insensitive read, and WhenWritingNull ignore — matching Typecast's API.
TypecastClient — TextToSpeechManager
| Method | Endpoint | Returns |
|---|---|---|
SynthesizeAsync(TypecastTtsRequest request, ct = default) |
POST /v1/text-to-speech |
byte[] (WAV or MP3 audio). |
TypecastClient — VoiceManager
| Method | Endpoint | Returns |
|---|---|---|
ListVoicesAsync(VoiceListReq? request = null, ct = default) |
GET /v2/voices |
List<Voice> (empty when absent). |
GetVoiceAsync(string voiceId, ct = default) |
GET /v2/voices/{voiceId} |
Voice? |
Request models
TypecastTtsRequest(extendsLyo.Tts.Models.TtsRequest) —VoiceId,Text,Model(defaults toTypecastModel.SsfmV30),Language(LanguageCodeInfo, serialised as ISO 639-3),Prompt,Output,Seed, computedAudioFormat.Prompt— emotion / style settings (including the"smart"mode with optionalprevious_text/next_textcontext).OutputSettings— volume / pitch / tempo / audio format.VoiceListReq— optionalModel,Gender,Age,UseCasesfilters.- Enums under
Enums/—Gender,AgeGroup,TypecastModel. - Response models under
Models/Voices/Response/—Voice,VoiceModel.
TypecastTtsRequestBuilder
Fluent builder for assembling a valid TTS request. Validates VoiceId and Text on Build().
var request = TypecastTtsRequestBuilder
.Create("tc_60e5426de8b95f1d3000d7b5", "Hello, world!")
.WithModel("ssfm-v30")
.WithLanguage("eng") // accepts ISO 639-3 or ISO 639-1
.WithSmartPrompt(previousText: "Welcome.", nextText: "How are you?")
.WithOutput(o => {
o.AudioFormat = "mp3";
})
.WithSeed(42)
.Build();
var audio = await client.TextToSpeech.SynthesizeAsync(request, ct);
| Method | Sets |
|---|---|
New() / Create(voiceId, text) |
Static factory methods. |
WithVoiceId(string) / WithText(string) |
Required fields. |
WithModel(string) |
e.g. "ssfm-v30", "ssfm-v21". |
WithLanguage(string) |
Parses ISO 639-3 first then ISO 639-1; falls back to no language when unknown. |
WithPrompt(Prompt) / WithPrompt(Action<Prompt>) |
Set or configure inline. |
WithSmartPrompt(previousText?, nextText?) |
Convenience for "smart" emotion mode. |
WithOutput(OutputSettings) / WithOutput(Action<OutputSettings>) |
Set or configure inline. |
WithSeed(int) |
Deterministic generation. |
Build() |
Validates required fields and returns the TypecastTtsRequest. |
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Api.Client— (direct, lyo)Lyo.Tts.Models— (direct, lyo)Microsoft.Extensions.Configuration.Binder10.0.5— (direct, microsoft)Microsoft.Extensions.DependencyInjection.Abstractions10.0.5— (direct, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5— (direct, microsoft)Lyo.Api.Models— (transitive, lyo)Lyo.Common— (transitive, lyo)Lyo.DateAndTime— (transitive, lyo)Lyo.Diagnostic— (transitive, lyo)Lyo.Exceptions— (transitive, lyo)Lyo.Hashing— (transitive, lyo)Lyo.PackageMetadata— (transitive, lyo)Lyo.Query.Models— (transitive, lyo)Lyo.Result— (transitive, lyo)Microsoft.Extensions.Http10.0.5— (transitive, microsoft)System.IO.Hashing10.0.5— (transitive, microsoft, net10.0)System.Memory4.6.3— (transitive, microsoft, netstandard2.0)System.Text.Json10.0.5— (transitive, microsoft, netstandard2.0)System.Threading.Tasks.Extensions4.6.3— (transitive, microsoft)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Lyo.Api.Client (>= 1.0.3)
- Lyo.Tts.Models (>= 1.0.3)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
-
net10.0
- Lyo.Api.Client (>= 1.0.3)
- Lyo.Tts.Models (>= 1.0.3)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Lyo.Typecast.Client:
| Package | Downloads |
|---|---|
|
Lyo.Tts.Typecast
Typecast Text-to-Speech service implementation for converting text to speech using Typecast API. |
GitHub repositories
This package is not used by any popular GitHub repositories.