Castle Game Engine: CastleSoundFile: Class TSoundOggVorbis

# Class TSoundOggVorbis
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleSoundFile ## Declaration `type TSoundOggVorbis = class(TSoundFile)` ## Description OggVorbis file loader. Internally we can use two implementations of OggVorbis handling: If AL_EXT_vorbis extension is available, then we will use this. The advantage of using AL_EXT_vorbis extension is that OpenAL does all the work, so 1. it's easy for us 2. OpenAL does it in a best way (uses streaming inside, so the OggVorbis data in decoded partially, on as-needed basis). The disadvantage is obviously that AL_EXT_vorbis must be present... And on Windows there doesn't seem a way to get the extension working anymore with new OpenAL. This hilarious message [http://opensource.creative.com/pipermail/openal/2006-April/009488.html] basically says that Creative will not fix AL_EXT_vorbis extension in Windows, because it's too easy to do. If AL_EXT_vorbis extension is not available but we have vorbisfile library available then we use vorbisfile functions to decode the file. While this works OK, the disadvantages of our current approach are that we decode the whole OggVorbis file in one go. This means that 1. we waste potentially a lot of memory to keep the whole uncompressed data — 5 MB OggVorbis file can easily take 50 MB in memory after decoding 2. whole decoding is done in one go, so there is a noticeable time delay when this takes place. The check for AL_EXT_vorbis extension and eventual decompression using vorbisfile directly take place in the first DataFormat call. You can also call method VorbisMethod to check which approach (if any) will be used. Note that both approaches require vorbisfile library to be installed (OpenAL AL_EXT_vorbis extension also works using vorbisfile library). If vorbisfile is not available, we cannot load OggVorbis sounds. ## Hierarchy TObject TSoundFile TSoundOggVorbis ## Overview ### Methods
| `constructor CreateFromStream(Stream: TStream); override;`
| `destructor Destroy; override;`
| `procedure PrepareOpenAL; override;`
| `function Data: Pointer; override;`
| `function DataSize: LongWord; override;`
| `function DataFormat: TALuint; override;`
| `function Frequency: LongWord; override;`
| `class function VorbisMethod: string;`
## Description ### Methods
| `constructor CreateFromStream(Stream: TStream); override;`
| `destructor Destroy; override;`
| `procedure PrepareOpenAL; override;`
| `function Data: Pointer; override;`
| `function DataSize: LongWord; override;`
| `function DataFormat: TALuint; override;`
| `function Frequency: LongWord; override;`
| `class function VorbisMethod: string;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:12