Shiny.Audio
3.0.0-beta-0033
Prefix Reserved
dotnet add package Shiny.Audio --version 3.0.0-beta-0033
NuGet\Install-Package Shiny.Audio -Version 3.0.0-beta-0033
<PackageReference Include="Shiny.Audio" Version="3.0.0-beta-0033" />
<PackageVersion Include="Shiny.Audio" Version="3.0.0-beta-0033" />
<PackageReference Include="Shiny.Audio" />
paket add Shiny.Audio --version 3.0.0-beta-0033
#r "nuget: Shiny.Audio, 3.0.0-beta-0033"
#:package Shiny.Audio@3.0.0-beta-0033
#addin nuget:?package=Shiny.Audio&version=3.0.0-beta-0033&prerelease
#tool nuget:?package=Shiny.Audio&version=3.0.0-beta-0033&prerelease
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 / file / URL playback (e.g. MP3) with optional normalizedAudioLevelChangedmetering for VU-style UI. Clips play concurrently:StartAsyncreturns anIAudioPlaybackyou can stop on its own,PlayAsyncwaits for one clip without interrupting the rest, andStopAsyncstops the lot.IAudioRecorder— record the microphone straight to a WAV file, optionally through a live effect chain, capturing the processed take, the raw one, or both.AudioEffectChain— real-time DSP on capture (pitch shift, echo, reverb, filters, distortion, ring modulation, chorus, gain, noise gate) that you toggle and re-tune while recording.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.WavWriter/WavReader— streaming RIFF/WAVE PCM I/O, plusAudioEffectProcessorfor applying an effect chain to a file that already exists.
Getting Started
using Shiny;
builder.Services.AddAudioServices(); // registers IAudioSource, IAudioPlayer, IAudioRecorder, ...
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(cancellationToken: ct);
// consume pcmStream ...
await audioSource.StopCaptureAsync();
}
}
Effects & recording
Effects are caller-owned objects. Build a chain, hand it to a capture or recording session, and keep the reference — toggling an effect or moving a parameter applies on the next audio buffer, with no restart and no clicks.
using Shiny.Audio;
var chain = new AudioEffectChain();
var pitch = chain.Add(new PitchShiftEffect { Semitones = 0 });
var echo = chain.Add(new EchoEffect { Enabled = false });
await recorder.StartAsync(new AudioRecordingOptions
{
Mode = AudioRecordMode.Both, // writes the processed and the raw take
Effects = chain
});
pitch.Semitones = 5; // heard immediately
echo.Enabled = true;
chain.Enabled = false; // master bypass
var recording = await recorder.StopAsync();
Available effects: GainEffect, NoiseGateEffect, BiquadFilterEffect, DistortionEffect,
RingModEffect, EchoEffect, ChorusEffect, ReverbEffect, PitchShiftEffect — plus
AudioEffectPresets.Create(...) for ready-made combinations (Robot, Chipmunk, DeepVoice, Cathedral,
Telephone, Megaphone, Ensemble).
Choosing the microphone
IAudioDevices lists the microphones the system sees (GetInputs(), with CurrentInput the system
default) and raises Changed when one is plugged in, removed or made the default. Hand one to a
recording or a capture session; null keeps the system default.
var mic = devices.GetInputs().FirstOrDefault(x => x.Type == AudioDeviceType.Usb);
await recorder.StartAsync(new AudioRecordingOptions { InputDevice = mic });
var pcm = await audioSource.StartCaptureAsync(new AudioCaptureOptions { InputDevice = mic });
| Platform | Inputs from | Capture from a chosen input |
|---|---|---|
| macOS | CoreAudio devices with input streams (UID as Id) |
The engine input node's I/O unit |
| Windows | Device enumeration (MediaDevice.GetAudioCaptureSelector) |
AudioGraph device input node |
| Linux | PulseAudio/PipeWire sources (monitors excluded), ALSA hints | The source / PCM by name |
| iOS / Mac Catalyst | AVAudioSession.AvailableInputs |
The session's preferred input |
| Android | AudioManager input devices |
AudioRecord preferred device |
A microphone unplugged since it was listed falls back to the system default rather than failing.
Do not put effects on audio bound for speech recognition — they destroy recognition and wake-word accuracy.
| 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.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-macos26.0 is compatible. net10.0-tvos was computed. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Shiny.Core (>= 5.2.3)
-
net10.0-android36.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Shiny.Core (>= 5.2.3)
-
net10.0-ios26.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Shiny.Core (>= 5.2.3)
-
net10.0-maccatalyst26.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Shiny.Core (>= 5.2.3)
-
net10.0-macos26.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Shiny.Core (>= 5.2.3)
-
net10.0-windows10.0.19041
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Shiny.Core (>= 5.2.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Shiny.Audio:
| Package | Downloads |
|---|---|
|
Shiny.Speech
Shiny Speech - Cross-platform speech-to-text and text-to-speech for .NET MAUI |
|
|
Shiny.Audio.Linux
Shiny Audio for Linux - microphone capture, playback, device enumeration and live mic monitoring over PulseAudio/PipeWire with an ALSA fallback |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-beta-0033 | 30 | 10/22/2026 |
| 3.0.0-beta-0032 | 70 | 10/21/2026 |
| 3.0.0-beta-0030 | 414 | 8/15/2026 |
| 3.0.0-beta-0029 | 187 | 8/8/2026 |
| 3.0.0-beta-0028 | 177 | 8/7/2026 |
| 3.0.0-beta-0027 | 178 | 8/5/2026 |
| 3.0.0-beta-0026 | 175 | 8/5/2026 |
| 3.0.0-beta-0024 | 177 | 8/5/2026 |
| 3.0.0-beta-0023 | 178 | 8/5/2026 |
| 3.0.0-beta-0022 | 195 | 8/2/2026 |
| 3.0.0-beta-0021 | 188 | 7/31/2026 |
| 3.0.0-beta-0020 | 169 | 7/30/2026 |
| 3.0.0-beta-0019 | 173 | 7/30/2026 |
| 3.0.0-beta-0018 | 196 | 7/27/2026 |
| 3.0.0-beta-0017 | 170 | 7/26/2026 |
| 3.0.0-beta-0016 | 165 | 7/24/2026 |
| 3.0.0-beta-0015 | 161 | 7/23/2026 |
| 3.0.0-beta-0014 | 197 | 7/11/2026 |
| 3.0.0-beta-0013 | 177 | 7/10/2026 |
| 3.0.0-beta-0012 | 167 | 7/9/2026 |