Castle Game Engine: CastleSoundFile: Class TSoundFile

# Class TSoundFile
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleSoundFile ## Declaration `type TSoundFile = class(TObject)` ## Description ## Hierarchy TObject TSoundFile ## Overview ### Methods
| `procedure CheckALExtension(const S: string);`
| `constructor CreateFromStream(Stream: TStream); virtual; abstract;`
| `class function CreateFromFile(const URL: string): TSoundFile;`
| `procedure PrepareOpenAL; virtual;`
| `function Data: Pointer; virtual; abstract;`
| `function DataSize: LongWord; virtual; abstract;`
| `function DataFormat: TALuint; virtual; abstract;`
| `function Frequency: LongWord; virtual; abstract;`
| `function Duration: TFloatTime;`
## Description ### Methods
| `procedure CheckALExtension(const S: string);`
| `constructor CreateFromStream(Stream: TStream); virtual; abstract;`
This will load a sound from a stream.
| `class function CreateFromFile(const URL: string): TSoundFile;`
Load a sound data, given an URL. This just opens the file as stream and then calls CreateFromStream of appropriate class, so see CreateFromStream for more info. For now, file format (which TSoundFile to use) is decided by the URL extension.
| `procedure PrepareOpenAL; virtual;`
Call this on this sound always after OpenAL is initialized and before passing this sound data to OpenAL. This may fix or check some things for this sound, checking e.g. whether some OpenAL extensions are supported. ###### Exceptions raised ESoundFormatNotSupportedByOpenAL if some OpenAL extension required to support this format is not present.
| `function Data: Pointer; virtual; abstract;`
Sound data, according to DataFormat. Contents of Data are readonly.
| `function DataSize: LongWord; virtual; abstract;`
Bytes allocated for Data.
| `function DataFormat: TALuint; virtual; abstract;`
Data format, as understood by OpenAL.
| `function Frequency: LongWord; virtual; abstract;`
| `function Duration: TFloatTime;`
Duration in seconds. Returns -1 if not known (DataSize or Frequency are zero, or DataFormat is unknown).
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:12