Shiny.Audio.Linux 3.0.0-beta-0032

Prefix Reserved
This is a prerelease version of Shiny.Audio.Linux.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Shiny.Audio.Linux --version 3.0.0-beta-0032
                    
NuGet\Install-Package Shiny.Audio.Linux -Version 3.0.0-beta-0032
                    
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="Shiny.Audio.Linux" Version="3.0.0-beta-0032" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Shiny.Audio.Linux" Version="3.0.0-beta-0032" />
                    
Directory.Packages.props
<PackageReference Include="Shiny.Audio.Linux" />
                    
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 Shiny.Audio.Linux --version 3.0.0-beta-0032
                    
#r "nuget: Shiny.Audio.Linux, 3.0.0-beta-0032"
                    
#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 Shiny.Audio.Linux@3.0.0-beta-0032
                    
#: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=Shiny.Audio.Linux&version=3.0.0-beta-0032&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Shiny.Audio.Linux&version=3.0.0-beta-0032&prerelease
                    
Install as a Cake Tool

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 / file / URL playback (e.g. MP3) with optional normalized AudioLevelChanged metering for VU-style UI. Clips play concurrently: StartAsync returns an IAudioPlayback you can stop on its own, PlayAsync waits for one clip without interrupting the rest, and StopAsync stops 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, plus AudioEffectProcessor for 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 Compatible and additional computed target framework versions.
.NET 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 Shiny.Audio.Linux:

Package Downloads
Shiny.AppDeviceBridge.Audio

The device's speakers and microphone for a Shiny.AppDeviceBridge web app, backed by Shiny.Audio — play clips from a URL or a file root, read and set the system volume, record the microphone to WAV with effect presets, list audio routes, and route the microphone live to the output, with level meters as events. One call: bridge.AddAudioBridge().

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0-beta-0002 43 11/12/2026
3.1.0-beta-0001 44 11/12/2026
3.0.0 161 10/30/2026
3.0.0-beta-0036 93 10/25/2026
3.0.0-beta-0035 100 10/24/2026
3.0.0-beta-0034 87 10/23/2026
3.0.0-beta-0033 102 10/22/2026
3.0.0-beta-0032 95 10/21/2026
3.0.0-beta-0030 121 8/15/2026
3.0.0-beta-0029 115 8/8/2026
3.0.0-beta-0028 112 8/7/2026
3.0.0-beta-0027 107 8/5/2026
3.0.0-beta-0026 116 8/5/2026
3.0.0-beta-0024 113 8/5/2026
3.0.0-beta-0023 113 8/5/2026
3.0.0-beta-0022 119 8/2/2026
3.0.0-beta-0021 113 7/31/2026
3.0.0-beta-0020 117 7/30/2026
3.0.0-beta-0019 109 7/30/2026