Home - Axwabo/SecretLabNAudio GitHub Wiki
SecretLabNAudio
Welcome to the SecretLabNAudio wiki! This project is not affiliated with, nor is endorsed by NAudio
[!TIP] Quick start: examples
[!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 access 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 volumeMinDistance- audio is heard atVolumeto 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.