Skip to main content
net10.0net10.0-android36.0net10.0-ios26.0net10.0-maccatalyst26.0net10.0-macos26.0net10.0-windows10.0.19041

Shiny Audio - Cross-platform audio capture and playback for .NET MAUI

Published
Jul 31, 2026
2mo ago
Total Downloads
4.6K
4,633

Install

dotnet add package Shiny.Audio --version 3.0.0-beta-0021
ProductVersions
.NET
net10.0net10.0-android36.0net10.0-ios26.0net10.0-maccatalyst26.0net10.0-macos26.0net10.0-windows10.0.19041

README

Shiny.Audio

Cross-platform audio capture and playback for .NET MAUI, iOS, Mac Catalyst, macOS, Android, Windows, Browser (WebAssembly), and Linux (via the companion Shiny.Audio.Linux package).

Shiny.Audio provides the low-level audio primitives that back Shiny.Speech, but is usable on its own:

  • IAudioSource β€” microphone capture that streams raw PCM audio (16kHz, 16-bit, mono) via a thread-safe PipeStream, with runtime permission handling (RequestAccess / AccessState) and a normalized InputLevelChanged VU signal on every platform.
  • IAudioPlayer β€” stream playback (e.g. MP3) with optional normalized AudioLevelChanged metering for VU-style UI.
  • AudioLevel β€” the shared dBFS mapping behind every meter (FromRms / FromPcm16 / FromSamples), so input and output bars read on the same scale β€” including PCM you meter yourself.

Getting Started

using Shiny;

builder.Services.AddAudioServices(); // registers IAudioSource + IAudioPlayer
using Shiny.Audio;

public class Recorder(IAudioSource audioSource)
{
    public async Task RecordAsync(CancellationToken ct)
    {
        if (await audioSource.RequestAccess() != AccessState.Available)
            return;

        var pcmStream = await audioSource.StartCaptureAsync(ct);
        // consume pcmStream ...
        await audioSource.StopCaptureAsync();
    }
}
Platform Audio Capture Audio Playback
iOS 15+ AVAudioEngine AVAudioPlayer
Android 26+ AudioRecord MediaPlayer
Windows 10 19041+ AudioGraph MediaPlayer
Browser (WASM) Web Audio API (getUserMedia + ScriptProcessorNode) HTML5 Audio
Linux PulseAudio / PipeWire (pa_simple), ALSA fallback PulseAudio / PipeWire (pa_simple), ALSA fallback

Linux

Linux ships as a separate Shiny.Audio.Linux package (it carries a managed MP3 decoder, since Linux has no system decoder to call). Add it and register before anything else:

builder.Services.AddLinuxAudio();   // no-op when not running on Linux

It supplies all four services β€” IAudioSource, IAudioPlayer, IAudioDevices and IAudioMonitor β€” over PulseAudio/PipeWire, falling back to ALSA on headless systems and containers.

See https://shinylib.net/speech for full documentation.

Changes from Previous Version

No structural changes between v3.0.0-beta-0020 and v3.0.0-beta-0021.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 6 target frameworks; confirm the exact target used by your application.The published metadata declares 18 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.