Jump to content


Photo

Gmfreesl - Openal Wrapper


  • Please log in to reply
2 replies to this topic

#1 BagnoHax

BagnoHax

    GMC Member

  • New Member
  • 7 posts

Posted 10 January 2010 - 01:41 PM

GMFreeSL


Download
http://lime-entertai...pl/GMFreeSL.zip

Lime Entertainment
http://lime-entertainment.pl


What's that?
GMFreeSL is an OpenAL wrapper powered by FreeSL library, which is OpenAL wrapper for C++.
It's still limited to some functions though, we'll add more if people'll like it.
Also, notice that OpenAL does NOT support MP3. It's commercial. If you want to use MP3 in your project,
go get FMOD or BASS.

Can I use it in my commercial game?
Yes, you can.

Do I have to credit someone?
Of course you do. There's instruction regarding this case in the "License.txt" file provided with GMFreeSL package.

How to use it?
To initialize GMFreeSL you'll have to call 2 functions and create an empty object.

First, put this code somewhere:
ALInitScripts();
ALInit();

Now, to creating an object.
Create an empty object and call it whatever you want.
Put this code into step event:
ALUpdate();

Now, put this code into game end event:
ALStopAll();
ALFreeAll();
ALShutdown();

To load a sound call ALLoadSound() or ALLoadSoundFromZip():
global.mysound = ALLoadSound(0, "sounds/mysound.ogg", 0); // Simple sound
global.mymusic = ALLoadSound(1, "sounds/mymusic.ogg", 1); // Stream, used for large sound files - Just like music.
ALLoadSoundFromZip() loads only simple sounds - for now.

To play a sound call ALSoundPlay, to stop it use ALSoundStop() etc.
ALSoundPlay(global.mysound);
ALSetSoundLoop(global.mymusic, 1); // Loop music
ALSoundPlay(global.music);

That'd be basic init.


What formats does OpenAL support?
Well unfortunately, simple sounds support:
- OGG
- WAV

Streams support only ogg... But can play an audio stream from avi file.

Edited by BagnoHax, 10 January 2010 - 02:24 PM.

  • 0

#2 PsichiX

PsichiX

    GMC Member

  • GMC Member
  • 399 posts
  • Version:GM:Studio

Posted 10 January 2010 - 02:06 PM

So what kind of audio formats are supported by your library? Only OGG?

Edited by PsichiX, 10 January 2010 - 02:08 PM.

  • 0

freckles_sign.png


#3 BagnoHax

BagnoHax

    GMC Member

  • New Member
  • 7 posts

Posted 10 January 2010 - 02:20 PM

So what kind of audio formats are supported by your library? Only OGG?

ALGetSoundFormats() or ALGetStreamFormats().
I just wrapped AL. I haven't coded my own lib.

Edited by BagnoHax, 10 January 2010 - 02:25 PM.

  • 0