Skip to content
Axwabo edited this page Feb 6, 2026 · 6 revisions

SecretLabNAudio

Welcome to the SecretLabNAudio wiki! This project is not affiliated with, nor is endorsed by NAudio

Important

If you're using v1, see the migration guide on how to upgrade.

Tip

It's recommended to use C# 14 or above to use extension properties. Set the <LangVersion> property in your csproj.

Core Concepts

For audio playback, SecretLabNAudio reads from an ISampleProvider to play audio in real time.

The AudioPlayer is a component added to a SpeakerToy managing the reading & encoding of audio.

A SendEngine sends the encoded audio messages to clients.

An IAudioPacketMonitor can monitor the samples independently of provider or send engine. It can be used to analyze audio, e.g. for visualization.

Tip

If you're not familiar with digital audio processing, check out this page

See also: creating an AudioPlayer short clips streaming from disk

ISampleProvider

The base interface for providing audio data.

SecretLabNAudio v2 introduced audio processors based on this interface, which make resource handling easier.

See the providers page for more information.

SpeakerSettings

This struct defines the following properties for a SpeakerToy

  • IsSpatial - whether the speaker is 3D (affected by listener position and rotation)
  • Volume - the base volume
  • MinDistance - audio is heard at Volume to this distance, then begins fading out (doesn't apply to 2D speakers)
  • MaxDistance - at this distance and beyond, the speaker becomes inaudible

You can apply them to a SpeakerToy or an AudioPlayer using the ApplySettings extension method.

Getting Started

Playing Audio

Advanced

Audio Processors

v1 Guides

Caution

v1 will be out of support soon.

Clone this wiki locally