Class TSoundOggVorbis

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSoundOggVorbis = class(TSoundFile)

Description

OggVorbis file loader.

Internally we can use two implementations of OggVorbis handling:

  1. 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.

  2. 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

Overview

Methods

Public constructor CreateFromStream(Stream: TStream); override;
Public destructor Destroy; override;
Public procedure PrepareOpenAL; override;
Public function Data: Pointer; override;
Public function DataSize: LongWord; override;
Public function DataFormat: TALuint; override;
Public function Frequency: LongWord; override;
Public class function VorbisMethod: string;

Description

Methods

Public constructor CreateFromStream(Stream: TStream); override;
 
Public destructor Destroy; override;
 
Public procedure PrepareOpenAL; override;
 
Public function Data: Pointer; override;
 
Public function DataSize: LongWord; override;
 
Public function DataFormat: TALuint; override;
 
Public function Frequency: LongWord; override;
 
Public class function VorbisMethod: string;
 

Generated by PasDoc 0.13.0 on 2013-08-17 21:27:14