Methods (13)
Namespace: CSCore

Syntax

public static class FluentExtensions

Summary

Provides a basic fluent API for creating a source chain.

Uses

Used by

Methods

AppendSource(TInput input, Func func)

Appends a source to an already existing source.

public static TResult AppendSource<TInput, TResult>(TInput input, Func func)

Parameters

input

TInput

Already existing source.

func

Func

Function which appends the new source to the already existing source.

Type Parameters

TInput

Input

TResult

Output

Returns

The return value of the func delegate.

AppendSource(TInput input, Func func, TResult& outputSource)

Appends a source to an already existing source.

public static TResult AppendSource<TInput, TResult>(TInput input, Func func, TResult& outputSource)

Parameters

input

TInput

Already existing source.

func

Func

Function which appends the new source to the already existing source.

outputSource

TResult&

Receives the return value.

Type Parameters

TInput

Input

TResult

Output

Returns

The return value of the func delegate.

ChangeSampleRate(ISampleSource input, Int32 destinationSampleRate)

Changes the SampleRate of an already existing sample source. Note: This extension has to convert the input to a IWaveSource and back to a ISampleSource.

public static ISampleSource ChangeSampleRate(ISampleSource input, Int32 destinationSampleRate)

Parameters

input

ISampleSource

Already existing sample source whose sample rate has to be changed.

destinationSampleRate

Int32

Destination sample rate.

Returns

Sample source with the specified destinationSampleRate.

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

ChangeSampleRate(IWaveSource input, Int32 destinationSampleRate)

Changes the SampleRate of an already existing wave source.

public static IWaveSource ChangeSampleRate(IWaveSource input, Int32 destinationSampleRate)

Parameters

input

IWaveSource

Already existing wave source whose sample rate has to be changed.

destinationSampleRate

Int32

Destination sample rate.

Returns

Wave source with the specified destinationSampleRate.

Loop(IWaveSource input)

Appends a new instance of the LoopStream class to the audio chain.

public static IWaveSource Loop(IWaveSource input)

Parameters

input

IWaveSource

The underlying IWaveSource which should be looped.

Returns

The new instance LoopStream instance.

Synchronized(TAudioSource audioSource)

Returns a thread-safe (synchronized) wrapper around the specified TAudioSource object.

public static SynchronizedWaveSource<T, TAudioSource> Synchronized<TAudioSource, T>(TAudioSource audioSource)

Parameters

audioSource

TAudioSource

The TAudioSource object to synchronize.

Type Parameters

TAudioSource

Type of the audioSource argument.

T

The type of the data read by the Read method of the audioSource method.

Returns

A thread-safe wrapper around the specified TAudioSource object.

Exceptions

ArgumentNullException

The audioSource is null.

ToMono(ISampleSource input)

Converts the specified sample source with n channels to a wave source with one channel. Note: If the input has only one channel, the ToMono extension has to convert the input to a IWaveSource and back to a ISampleSource.

public static ISampleSource ToMono(ISampleSource input)

Parameters

input

ISampleSource

Already existing sample source.

Returns

ISampleSource instance with one channels

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

ToMono(IWaveSource input)

Converts the specified wave source with n channels to a wave source with one channel. Note: If the input has two channels, the ToMono extension has to convert the input to a ISampleSource and back to a IWaveSource.

public static IWaveSource ToMono(IWaveSource input)

Parameters

input

IWaveSource

Already existing wave source.

Returns

IWaveSource instance with one channel.

CSCore.FluentExtensionsCSCore.DSP.ChannelMatrixToMonoif (input.WaveFormat.Channels == 2)ToWaveSourceToSampleSourceendif (format != null)GetMatrixreturn ChannelMatrixendreturn IWaveSource

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

ToSampleSource(IWaveSource waveSource)

Converts a IWaveSource to a ISampleSource.

public static ISampleSource ToSampleSource(IWaveSource waveSource)

Parameters

waveSource

IWaveSource

The IWaveSource to convert to a ISampleSource.

Returns

The ISampleSource wrapped around the specified waveSource.

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

ToStereo(ISampleSource input)

Converts the specified sample source with n channels to a wave source with two channels. Note: If the input has more than two channels, the ToStereo extension has to convert the input to a IWaveSource and back to a ISampleSource.

public static ISampleSource ToStereo(ISampleSource input)

Parameters

input

ISampleSource

Already existing sample source.

Returns

ISampleSource instance with two channels.

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

ToStereo(IWaveSource input)

Converts the specified wave source with n channels to a wave source with two channels. Note: If the input has only one channel, the ToStereo extension has to convert the input to a ISampleSource and back to a IWaveSource.

public static IWaveSource ToStereo(IWaveSource input)

Parameters

input

IWaveSource

Already existing wave source.

Returns

IWaveSource instance with two channels.

CSCore.FluentExtensionsCSCore.DSP.ChannelMatrixToStereoif (input.WaveFormat.Channels == 1)ToWaveSourceToSampleSourceendif (input.WaveFormat is WaveFormatExtensible)GetMatrixreturn ChannelMatrixendreturn IWaveSource

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom

ToWaveSource(ISampleSource sampleSource)

Converts a IWaveSource to IeeeFloat (32bit) IWaveSource.

public static IWaveSource ToWaveSource(ISampleSource sampleSource)

Parameters

sampleSource

ISampleSource

The ISampleSource to convert to a IWaveSource.

Returns

The IWaveSource wrapped around the specified sampleSource.

ToWaveSource(ISampleSource sampleSource, Int32 bits)

Converts a SampleSource to either a Pcm (8, 16, or 24 bit) or IeeeFloat (32 bit) WaveSource.

public static IWaveSource ToWaveSource(ISampleSource sampleSource, Int32 bits)

Parameters

sampleSource

ISampleSource

Sample source to convert to a wave source.

bits

Int32

Bits per sample.

Returns

Wave source

Class Diagram

public static classFluentExtensionsAppendSourceAppendSourceChangeSampleRateChangeSampleRateLoopSynchronizedToMonoToMonoToSampleSourceToStereoToStereoToWaveSourceToWaveSourcepublic classWasapiOutStoppedDisposeDisposeFinalizeInitializePausePlayResumeStopWasapiOutWasapiOutWasapiOutWasapiOutDebuggingId { get; }Device { get; set; }IsSupportedOnCurrentPlatform { get; }Latency { get; set; }PlaybackState { get; }UseChannelMixingMatrices { get; set; }Volume { get; set; }WaveSource { get; }public classWaveOutStoppedCreateWaveOutHandleDisposeDisposeFinalizeInitializePausePlayResumeStopWaveOutWaveOutDevice { get; set; }Latency { get; set; }PlaybackState { get; }UseChannelMixingMatrices { get; set; }Volume { get; set; }WaveSource { get; }public classChannelMatrixFiveDotOneSurroundWithRearToMonoFiveDotOneSurroundWithRearToSevenDotOneFiveDotOneSurroundWithRearToStereoFiveDotOneSurroundWithSideToMonoFiveDotOneSurroundWithSideToSevenDotOneFiveDotOneSurroundWithSideToStereoMonoToFiveDotOneSurroundWithRearMonoToFiveDotOneSurroundWithSideMonoToSevenDotOneSurroundMonoToStereoMatrixSevenDotOneSurroundToFiveDotOneSurroundWithRearSevenDotOneSurroundToFiveDotOneSurroundWithSideSevenDotOneSurroundToMonoSevenDotOneSurroundToStereoStereoToFiveDotOneSurroundWithRearStereoToFiveDotOneSurroundWithSideStereoToMonoMatrixStereoToSevenDotOneSurroundFlipGetMatrixGetMatrixGetOneDimensionalMatrixSetMatrixChannelMatrixHeight { get; }InputChannelCount { get; }InputMask { get; }Item { get; set; }OutputChannelCount { get; }OutputMask { get; }Width { get; }public abstract classWaveToSampleBaseBufferSourceCreateConverterDisposeDisposeFinalizeReadWaveToSampleBaseCanSeek { get; }Length { get; }Position { get; set; }WaveFormat { get; }

save

reset

Drag to pan - Use Mousewheel + Ctrl to zoom