Shiny.Audio
Shiny Audio - Cross-platform audio capture and playback for .NET MAUI
Install
| Product | Versions |
|---|---|
| .NET |
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-safePipeStream, with runtime permission handling (RequestAccess/AccessState) and a normalizedInputLevelChangedVU signal on every platform.IAudioPlayerβ stream playback (e.g. MP3) with optional normalizedAudioLevelChangedmetering 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
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.