CasCap.Api.Azure.CognitiveServices 1.6.3

Prefix Reserved
dotnet add package CasCap.Api.Azure.CognitiveServices --version 1.6.3
                    
NuGet\Install-Package CasCap.Api.Azure.CognitiveServices -Version 1.6.3
                    
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="CasCap.Api.Azure.CognitiveServices" Version="1.6.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Api.Azure.CognitiveServices" Version="1.6.3" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Api.Azure.CognitiveServices" />
                    
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 CasCap.Api.Azure.CognitiveServices --version 1.6.3
                    
#r "nuget: CasCap.Api.Azure.CognitiveServices, 1.6.3"
                    
#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 CasCap.Api.Azure.CognitiveServices@1.6.3
                    
#: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=CasCap.Api.Azure.CognitiveServices&version=1.6.3
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Api.Azure.CognitiveServices&version=1.6.3
                    
Install as a Cake Tool

CasCap.Api.Azure.CognitiveServices

Helper library for Azure Cognitive Services. Provides text-to-speech synthesis and speech-to-text recognition via the Azure Speech SDK.

Installation

dotnet add package CasCap.Api.Azure.CognitiveServices

Services / Extensions

Type Name Description
Interface ISpeechService Abstraction for speech synthesis (TTS) and speech recognition (STT).
Service SpeechService Implements ISpeechService using Microsoft.CognitiveServices.Speech for synthesis and recognition, and Azure.AI.Speech.Transcription for fast transcription. Supports subscription key and TokenCredential authentication.

Key Methods

  • CreateWAV(string soundByte, string path) — Synthesizes text to a WAV file.
  • SynthesizeAsync(string text, string? voice, CancellationToken) — Synthesizes text and returns Ogg Opus audio, or null when synthesis produced nothing.
  • TranscribeAsync(Stream audio, IReadOnlyList<string>? locales, CancellationToken) — Transcribes an audio stream through the fast transcription API.
  • RecognizeFromWAV(string path) — Transcribes speech from a WAV file.
  • RecognizeFromMicrophone() — Transcribes speech from the default microphone.

Prefer SynthesizeAsync over CreateWAV for synthesis. It returns the bytes, so no temporary file is needed, and it emits Opus in an Ogg container, which is the format messaging clients expect for voice notes. Pass voice as a full name such as en-GB-SoniaNeural; omit it to use the resource default.

Prefer TranscribeAsync for recorded audio. It takes a stream, so no temporary file is needed, and it transcribes the whole recording, where the Recognize* methods stop at the first utterance and so silently truncate anything longer than roughly fifteen seconds. It requires the endpoint and credential constructor, because the subscription-key constructor does not carry the resource endpoint that the fast transcription API needs, and the credential needs the Cognitive Services Speech User role on the resource.

Configuration

Class Section Properties
CognitiveServicesConfig CasCap:CognitiveServicesConfig SubscriptionKey (required)

Dependencies

NuGet Packages

Package
Azure.AI.Speech.Transcription
Microsoft.CognitiveServices.Speech
CasCap.Common.Logging
CasCap.Common.Extensions

Project References

None.

Product Compatible and additional computed target framework versions.
.NET 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CasCap.Api.Azure.CognitiveServices:

Package Downloads
CasCap.Api.Voice

Provider-neutral speech-to-text and text-to-speech components for .NET applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.3 167 9/25/2026
1.6.2 180 9/23/2026
1.6.1 101 9/21/2026
1.6.0 140 9/19/2026
1.5.5 115 9/11/2026
1.5.4 96 9/1/2026
1.5.3 119 8/18/2026
1.5.2 130 7/15/2026
1.5.1 149 6/26/2026
1.5.0 131 6/12/2026
1.4.13 130 6/10/2026
1.4.12 255 5/27/2026
1.4.11 150 5/26/2026
1.4.10 182 5/21/2026
1.4.9 128 5/20/2026
1.4.8 293 5/13/2026
1.4.7 192 5/8/2026
1.4.6 137 5/4/2026
1.4.5 123 5/4/2026
1.4.4 220 4/23/2026
Loading failed