-
Notifications
You must be signed in to change notification settings - Fork 0
Formats
The AudioReaderFactoryManager class holds the factories used to create
WaveStreams based on file extensions. You can register your own factories.
SecretLabNAudio.Core itself supports wav and aiff files.
To add support for mp3 and ogg containers, install the required modules
or choose the full SecretLabNAudio installation.
Tip
See the README for installation steps.
| Format | Pros | Cons |
|---|---|---|
wav |
Very fast decoding | Large file size |
mp3 |
Widely used | Very slow to decode |
ogg (Ogg Vorbis) |
Smallest file size | A bit slow to decode |
aiff |
Fast decoding | Large file size, macOS standard |
Tip
Check out FFmpeg which supports essentially every format.
Implement the IAudioReaderFactory interface and pass an instance to
AudioReaderFactoryManager.RegisterFactory with the file type.
The IAudioReaderFactory defines methods to create WaveStreams and/or ISampleProviders, given a path or a Stream
Both methods return an AudioReaderFactoryResult which has an implicit conversion
from a WaveStream that sets the provider using ToSampleProvider
using NAudio.Wave;
using SecretLabNAudio.Core.FileReading;
public AudioReaderFactoryResult FromPath(string path) => new WaveFileReader(path);
// is the same as
public AudioReaderFactoryResult FromPath(string path)
{
var reader = new WaveFileReader(path);
return new AudioReaderFactoryResult(reader, reader.ToSampleProvider());
}- π Home
- πΌ Digital Audio Basics
- π Examples
- π¦ Supported Formats
- β¬οΈ Migrating from v1
- π AudioPlayer
- πΎ Short Clips
- πΏ Streaming From Disk
- ποΈ Speaker Groups
- π Sample Providers
- β»οΈ Pooling
- π¨ SendEngines
- π§ Personalizing Speakers
- π Monitoring Output
- βοΈ AudioQueue
- πΆ Mixer
- ποΈοΈ ProcessorChain
- π§° Intro to FFmpeg
- π© Installation
- ποΈ FFmpegArguments
- πͺ Adding Short Clips
- π FFmpeg Audio Processors
- ποΈ Caches
Caution
v1 will be out of support soon.