HPD-Agent.Audio 0.9.5

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

HPD-Agent.Audio

HPD-owned audio contracts, deterministic runtime coordination, and AgentBuilder integration for speech-to-text, text-to-speech, realtime audio, voice activity, interruptions, and transport-backed live sessions.

Install

dotnet add package HPD-Agent.Audio
dotnet add package HPD-Agent.Providers.Audio.OpenAI
dotnet add package HPD-Agent.Providers.Audio.ElevenLabs

Install only the provider packages used by the application. Local voice activity is available through HPD-Agent.Providers.Audio.Silero.

Package map

Package or artifact Purpose 1.0 status
HPD-Agent.Audio Runtime contracts, orchestration, events, output sinks Supported
HPD-Agent.Providers.Audio.OpenAI Batch/realtime STT, TTS, realtime model audio Supported
HPD-Agent.Providers.Audio.ElevenLabs STT and TTS Supported
HPD-Agent.Providers.Audio.Silero Local PCM16 voice activity Supported on qualified RIDs
HPD-Agent.Audio.LiveKit Managed LiveKit room transport Supported on osx-arm64
Browser Web Audio qualification Virtual browser playout/capture checks Private diagnostic
SIP/PBX telephony qualification Asterisk/PCMU RTP checks Private diagnostic

Packable audio projects target net8.0, net9.0, and net10.0 unless a package documents a narrower runtime or platform scope.

Concepts

  • AudioInputMode selects batch STT, streaming STT, provider realtime audio, or reference-only behavior.
  • AudioOutputMode selects text-only, completed-text TTS, or provider realtime audio.
  • AssistantOutputSynthesisMode controls final-text synthesis and progressive synthesis.
  • An IAudioOutputSink owns playback. HPD publishes audio even when no playback sink is attached.
  • AssistantAudioArtifactCapturePolicy controls whether synthesized audio is stored as a content artifact, referenced by digest, or discarded.
  • Audio work is instrumented with structured AgentEvent records, ledgers, and trace records.

Text-to-speech

Configure a chat client and a TTS provider, then opt into audio output:

using HPD.Agent;
using HPD.Agent.Audio;
using HPD.Agent.Providers.Audio.OpenAI;

var agent = await AgentBuilder.Create()
    .WithEventApplicationIdentity("Contoso.AudioApp")
    .WithChatClient(chatClient)
    .WithContentStore(contentStore)
    .WithOpenAITextToSpeech(
        model: "gpt-4o-mini-tts",
        voice: "alloy")
    .WithAudio(audio =>
    {
        audio.OutputMode = AudioOutputMode.TextToSpeech;
        audio.AssistantOutputMode = AssistantOutputSynthesisMode.FinalText;
        audio.ArtifactCapturePolicy =
            AssistantAudioArtifactCapturePolicy.ContentStoreArtifact;
    })
    .BuildAsync();

OPENAI_API_KEY is the default environment secret alias. Supply playback by setting AudioRuntimeAttachmentOptions.AssistantAudioOutputSink and EnableAssistantOutputPlayback, or use the managed LiveKit transport.

Subscribe to AssistantAudioOutputArtifactCapturedEvent for completed audio, AssistantAudioOutputChunkReadyEvent for streamed chunks, and the playback events when a sink reports playout truth.

Batch speech-to-text

.WithOpenAISpeechToText("gpt-4o-transcribe")
.WithAudio(audio =>
{
    audio.InputMode = AudioInputMode.BatchSpeechToText;
    audio.OutputMode = AudioOutputMode.TextOnly;
})

Send a ChatMessage containing AudioContent. The transcribed text is projected into the user message before the chat model runs. Raw audio continues to require a content store or a caller-owned input-content resolver.

Realtime audio

.WithOpenAIRealtime("gpt-realtime")
.WithAudio(audio =>
{
    audio.InputMode = AudioInputMode.ProviderRealtime;
    audio.OutputMode = AudioOutputMode.ProviderRealtimeAudio;
})

Realtime runs use AgentModelTransportMode.Realtime. Subscribe to UserAudioTranscriptDeltaEvent, UserAudioTranscriptCompletedEvent, and UserAudioTranscriptFailedEvent for input diagnostics.

Failure diagnostics

Assistant audio failures carry AudioErrorInfo, including a stable code, message, category, retryability, and optional provider metadata. Realtime user transcript failures carry ProviderErrorInfo with normalized category, retryability, status code, provider request ID, and retry delay when available.

Treat synthesis failure as recoverable text-only output when the chat response itself succeeded. Treat transport or playback failure as an output-delivery failure, not a failed model turn.

Supported audio assumptions

  • Managed retained STT currently requires decoded mono PCM16 input.
  • OpenAI retained realtime transcription requires manual commit authority.
  • Provider-native realtime audio has provider-specific format and lifecycle constraints.
  • Playback is only reported as heard when the configured sink supplies authoritative playback evidence.
  • Live transport support is separate from the core package. See the individual transport package README for platform and packaging constraints.

The HPD-Agent.AudioCli project in the repository is an executable diagnostic harness for provider and transport qualification. It is not a replacement for application-level playback or transport integration.

Repository maintainers can run the credentialed provider smoke test with:

OPENAI_API_KEY=... ELEVENLABS_API_KEY=... \
  bash eng/test-audio-live-smoke.sh all

The corresponding HPD Agent Audio Live Smoke workflow runs the same batch STT/chat/TTS and realtime qualification paths.

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 (7)

Showing the top 5 NuGet packages that depend on HPD-Agent.Audio:

Package Downloads
HPD-Agent.FFI

Package Description

HPD-Agent.MultiAgent

Fluent multi-agent orchestration library built on HPD-Graph. Zero-ceremony agent workflows with unified event streaming.

HPD-Agent.Providers.Audio.OpenAI

OpenAI audio provider adapters for HPD Agent audio.

HPD-Agent.Providers.Audio.Silero

Silero voice activity detection provider adapter for HPD Agent audio.

HPD-Agent.Providers.Audio.ElevenLabs

ElevenLabs audio provider adapters for HPD Agent audio.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.5 182 11/10/2026
0.9.2 185 11/2/2026
0.9.1 218 10/21/2026
0.9.0 193 10/20/2026
0.8.1 255 8/6/2026
0.8.0 223 8/5/2026
0.7.0 236 7/19/2026
0.6.0 234 7/4/2026
0.5.5 241 6/21/2026
0.5.0 252 6/11/2026