C# 클래스 SunsetHigh.BGMusic.FadeInOutSampleProviderAdapted

This helper class is lifted straight out of NAudio samples (with minor edits) to allow for fading/looping
상속: ISampleProvider
파일 보기 프로젝트 열기: ErraticUnicorn/MOSH

공개 메소드들

메소드 설명
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