C# Class xZune.Bass.AudioSample

A audio sample.
Inheritance: HandleObject, ISample
显示文件 Open project: higankanshi/xZune.Bass

Public Methods

Method Description
AudioSample ( MemoryStream stream, uint max, SampleLoadConfig config ) : System

Create a sample form a WAV, AIFF, MP3, MP2, MP1, OGG or plug-in supported file sample stream.

AudioSample ( String file, System.UInt64 offset, uint length, uint max, SampleLoadConfig config ) : System

Create a sample form a WAV, AIFF, MP3, MP2, MP1, OGG or plug-in supported file sample.

AudioSample ( uint length, uint freq, uint channels, uint max, SampleConfig config ) : System

Creates a new sample.

GetChannel ( bool recycle ) : SampleChannel

Creates/initializes a playback channel for a sample.

GetChannels ( ) : xZune.Bass.SampleChannel[]

Get all a sample's existing channels.

Stop ( ) : void

Stops all channels instances of a sample.

Protected Methods

Method Description
AudioSample ( ) : System
Free ( ) : void
ReleaseManaged ( ) : void
ReleaseUnmanaged ( ) : void

Method Details

AudioSample() protected method

protected AudioSample ( ) : System
return System

AudioSample() public method

Create a sample form a WAV, AIFF, MP3, MP2, MP1, OGG or plug-in supported file sample stream.
public AudioSample ( MemoryStream stream, uint max, SampleLoadConfig config ) : System
stream System.IO.MemoryStream A .NET memory stream.
max uint /// Maximum number of simultaneous playbacks... 1 (min) - 65535 (max)... use one of the /// SampleConfig.OverXX flags to choose the override decider, in the case of there being no free channel available for /// playback (ie. the sample is already playing max times). ///
config SampleLoadConfig Some configures of sample.
return System

AudioSample() public method

Create a sample form a WAV, AIFF, MP3, MP2, MP1, OGG or plug-in supported file sample.
public AudioSample ( String file, System.UInt64 offset, uint length, uint max, SampleLoadConfig config ) : System
file String File name.
offset System.UInt64 File offset to load the sample from.
length uint /// Data length... 0 = use all data up to the end of file. If length over-runs the end of the file, it /// will automatically be lowered to the end of the file. ///
max uint /// Maximum number of simultaneous playbacks... 1 (min) - 65535 (max)... use one of the /// SampleConfig.OverXX flags to choose the override decider, in the case of there being no free channel available for /// playback (ie. the sample is already playing max times). ///
config SampleLoadConfig Some configures of sample.
return System

AudioSample() public method

Creates a new sample.
/// Bass DLL not loaded, you must use to load Bass DLL /// first. /// /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. ///
public AudioSample ( uint length, uint freq, uint channels, uint max, SampleConfig config ) : System
length uint The sample's length, in bytes.
freq uint The default sample rate.
channels uint The number of channels... 1 = mono, 2 = stereo, etc.
max uint /// Maximum number of simultaneous playbacks... 1 (min) - 65535 (max)... use one of the /// SampleConfig.OverXX flags to choose the override decider, in the case of there being no free channel available for /// playback (ie. the sample is already playing max times). ///
config SampleConfig Some configures of sample.
return System

Free() protected method

Channel object is no longer available. /// Bass DLL not loaded, you must use to load Bass DLL /// first. /// /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. ///
protected Free ( ) : void
return void

GetChannel() public method

Creates/initializes a playback channel for a sample.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to load Bass DLL /// first. ///
public GetChannel ( bool recycle ) : SampleChannel
recycle bool Recycle on of the existing channels, then to create a new.
return SampleChannel

GetChannels() public method

Get all a sample's existing channels.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to load Bass DLL /// first. ///
public GetChannels ( ) : xZune.Bass.SampleChannel[]
return xZune.Bass.SampleChannel[]

ReleaseManaged() protected method

protected ReleaseManaged ( ) : void
return void

ReleaseUnmanaged() protected method

protected ReleaseUnmanaged ( ) : void
return void

Stop() public method

Stops all channels instances of a sample.
Channel object is no longer available. /// Some error occur to call a Bass function, check the error code and error message /// to get more error information. /// /// Bass DLL not loaded, you must use to load Bass DLL /// first. ///
public Stop ( ) : void
return void