Free Game Audio Manager Wrapper Class In Delphi XE6 Firemonkey For Android, IOS, Windows, and OSX


If you want to be able to play multiple simultaneous audio files across all platforms in Delphi XE6 Firemonkey you should check out this TGameAudioManager class. I had it built by a professional developer through oDesk and it is architected for playing lots of short sound files (like game sound effects) in Firemonkey. I had need of this class when I was building the Flappy Bird clone and finally got around to having it built. It uses the native sound API from each of the supported platforms which are Windows, Android, IOS, and OSX. The least amount of testing has been done on the OSX implementation but overall it feels pretty solid. For music (long running audio files) you should stick with the built in TMediaPlayer component. The TGameAudioManager class is built so that you pre-register the sounds that you are going to play with AddSound() and then you play them with PlaySound(). It is written in Object Pascal and should also compile in AppMethod (and probably Delphi XE5) without much trouble. There is a mobile and a desktop demo included in the archive. Here is the class type information:
  TGameAudioManager = Class
fSoundsList : TList;
fAudioMgr : JAudioManager;
fSoundPool : JSoundPool;
function GetSoundsCount : integer;
function GetSoundFromIndex(Aindex : integer) : PSoundRec;
Constructor Create;
Destructor Destroy;override;
function AddSound(ASoundFile: string) : integer;
procedure DeleteSound(AName : String); overload;
procedure DeleteSound(AIndex : integer); overload;
procedure PlaySound(AName : String);overload;
procedure PlaySound(AIndex : integer);overload;
property SoundsCount : Integer read GetSoundsCount;
property Sounds[AIndex : integer] : PSoundRec read GetSoundFromIndex ;
Download TGameAudioManager, the free audio manager wrapper class in Delphi XE6 Firemonkey for Android, IOS, Windows, and OSX.

Comments are closed.