-
Notifications
You must be signed in to change notification settings - Fork 0
v1 Providers
Caution
This page is for v1 of SecretLabNAudio. v2 guide
SecretLabNAudio.Core includes some ISampleProvider classes for convenience.
Loops the given WaveStream
Uses a PlaybackBuffer and reads as much data as possible into the buffer when Read is called.
Exposes methods to read & write from a PlaybackBuffer
Reads data from a float array. This array is stored in a private field, but the caller may modify it if they have a reference to the array passed to the constructor.
The Copy method creates a new RawSourceSampleProvider that references the original array.
This way, different providers can seek to different positions without reallocating the entire array.
Loops the given RawSourceSampleProvider
Exposes methods to enqueue & dequeue providers from a queue, and reads from them sequentially.
Some important sample providers contained in NAudio.Core are:
-
MixingSampleProvider- combines multiple inputs into one -
ConcatenatingSampleProvider- sequentially plays the given providers -
VolumeSampleProvider- sets the volume -
OffsetSampleProvider- has multiple properties:-
DelayBy- silence to insert before playing the source -
SkipOver- time to discard from the beginning of the source -
Take- limits the maximum samples to read from the source -
LeadOut- time of appended silence at the end
-
ToSampleProvider(IWaveProvider)-
FollowedBy(ISampleProvider, ISampleProvider)- concats two providers
-
ToPlayerCompatible(ISampleProvider)- mixes down and resamples forAudioPlayercompatibility (if required) -
MixWith(ISampleProvider, ISampleProvider)- mixes two inputs. The first input is returned if it's aMixingSampleProvider- a new mixer is created otherwise -
Buffer(ISampleProvider, double)- creates aBufferedSampleProvider -
Queue(ISampleProvider, ISampleProvider)- uses the first or creates a newSampleProviderQueue -
Volume(ISampleProvider, float)- uses the original or creates a newVolumeSampleProvider -
ToPlayerCompatible(IWaveProvider)- converts to a sample provider and callsToPlayerCompatible -
Loop(WaveStream)- creates aLoopingWaveProvider -
ReadPlayerCompatibleSamples(WaveStream, bool)- reads the stream into a player-compatibleRawSourceSampleProvider -
ReadSamples(WaveStream, bool)- reads the samples into aRawSourceSampleProviderwith the original format
- π 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.