C# Class GAudio.AGATAudioFile

Base class for reading ogg and uncompressed wav files, from disk or memory streams. Use OpenAudioFileAtPath to retrieve an instance. GATPathsHelper provides handy methods for converting relative paths to absolute paths. Don't forget to call Dispose() to close the file and release resources!
Inheritance: IDisposable
Mostra file Open project: gregzo/G-Audio Class Usage Examples

Public Properties

Property Type Description
filePath string

Protected Properties

Property Type Description
_readChunkSize int

Public Methods

Method Description
Dispose ( ) : void

Releases all resource used by the GATAsyncWavWriter object.

Call Dispose when you are finished using the GATAsyncWavWriter. The Dispose method leaves the GATAsyncWavWriter in an unusable state. After calling Dispose, you must release all references to the GATAsyncWavWriter so the garbage collector can reclaim the memory that the GATAsyncWavWriter was occupying.

OpenAudioFileAtPath ( string path ) : AGATAudioFile

Creates and returns a ready to use AGATAudioFile object. Wrap in a try catch block if you are not sure that the file type is supported.

OpenAudioFileFromStream ( Stream stream, string format ) : AGATAudioFile

Creates and returns a ready to use AGATAudioFile object. Wrap in a try catch block if you are not sure that the file type is supported.

ReadNextChunk ( float target, int offset, int numFrames ) : int

Reads the next chunk into the target array at offset. Multichannel data is always interleaved.

Protected Methods

Method Description
AGATAudioFile ( ) : System
AGATAudioFile ( string path ) : System
FreeResources ( ) : void

Private Methods

Method Description
Dispose ( bool explicitly ) : void

Method Details

AGATAudioFile() protected method

protected AGATAudioFile ( ) : System
return System

AGATAudioFile() protected method

protected AGATAudioFile ( string path ) : System
path string
return System

Dispose() public method

Releases all resource used by the GATAsyncWavWriter object.
Call Dispose when you are finished using the GATAsyncWavWriter. The Dispose method leaves the GATAsyncWavWriter in an unusable state. After calling Dispose, you must release all references to the GATAsyncWavWriter so the garbage collector can reclaim the memory that the GATAsyncWavWriter was occupying.
public Dispose ( ) : void
return void

FreeResources() protected abstract method

protected abstract FreeResources ( ) : void
return void

OpenAudioFileAtPath() public static method

Creates and returns a ready to use AGATAudioFile object. Wrap in a try catch block if you are not sure that the file type is supported.
public static OpenAudioFileAtPath ( string path ) : AGATAudioFile
path string
return AGATAudioFile

OpenAudioFileFromStream() public static method

Creates and returns a ready to use AGATAudioFile object. Wrap in a try catch block if you are not sure that the file type is supported.
public static OpenAudioFileFromStream ( Stream stream, string format ) : AGATAudioFile
stream Stream
format string
return AGATAudioFile

ReadNextChunk() public abstract method

Reads the next chunk into the target array at offset. Multichannel data is always interleaved.
public abstract ReadNextChunk ( float target, int offset, int numFrames ) : int
target float
offset int
numFrames int
return int

Property Details

_readChunkSize protected_oe property

protected int _readChunkSize
return int

filePath public_oe property

The file path.
public string filePath
return string