C# Класс SunsetHigh.BGMusic.FadeInOutSampleProviderAdapted

This helper class is lifted straight out of NAudio samples (with minor edits) to allow for fading/looping
Наследование: ISampleProvider
Показать файл Открыть проект

Открытые методы

Метод Описание
BeginFadeIn ( double fadeDurationInMilliseconds ) : void

Requests that a fade-in begins (will start on the next call to Read)

BeginFadeOut ( double fadeDurationInMilliseconds ) : void

Requests that a fade-out begins (will start on the next call to Read)

FadeInOutSampleProviderAdapted ( AudioFileReader source, bool initiallySilent = false ) : System

Creates a new FadeInOutSampleProvider

Read ( float buffer, int offset, int count ) : int

Reads samples from this sample provider

isLooping ( ) : bool

Returns whether the current song is looping (true by default)

setLooping ( bool looping ) : void

Sets whether the current song should loop or not (true by default)

Приватные методы

Метод Описание
ClearBuffer ( float buffer, int offset, int count ) : void
FadeIn ( float buffer, int offset, int sourceSamplesRead ) : void
FadeOut ( float buffer, int offset, int sourceSamplesRead ) : void

Описание методов

BeginFadeIn() публичный Метод

Requests that a fade-in begins (will start on the next call to Read)
public BeginFadeIn ( double fadeDurationInMilliseconds ) : void
fadeDurationInMilliseconds double Duration of fade in milliseconds
Результат void

BeginFadeOut() публичный Метод

Requests that a fade-out begins (will start on the next call to Read)
public BeginFadeOut ( double fadeDurationInMilliseconds ) : void
fadeDurationInMilliseconds double Duration of fade in milliseconds
Результат void

FadeInOutSampleProviderAdapted() публичный Метод

Creates a new FadeInOutSampleProvider
public FadeInOutSampleProviderAdapted ( AudioFileReader source, bool initiallySilent = false ) : System
source NAudio.Wave.AudioFileReader The source stream with the audio to be faded in or out
initiallySilent bool If true, we start faded out
Результат System

Read() публичный Метод

Reads samples from this sample provider
public Read ( float buffer, int offset, int count ) : int
buffer float Buffer to read into
offset int Offset within buffer to write to
count int Number of samples desired
Результат int

isLooping() публичный Метод

Returns whether the current song is looping (true by default)
public isLooping ( ) : bool
Результат bool

setLooping() публичный Метод

Sets whether the current song should loop or not (true by default)
public setLooping ( bool looping ) : void
looping bool
Результат void