Why I think you should use my DLL (Pros): - A very simple interface - 3D sound support - Simplified volume control (through group flags and fading) - OGG streaming support - No crazy DLL dependencies (except OpenAL, of course) - Fresh code - I'm able to add requested features - Documentation is in script files - you don't have to look too far to know how it works - Plays sound as every other player (AFAIK, GM did something odd to the sound files)
The only reasons why you wouldn't need it (Cons / preference mismatch): - You like working with ugly interfaces (let's face it, this DLL might be one of the best things you've found this week ) - You hate WAV/OGG file formats (only these are and will be supported in this audio DLL) - You cannot afford to put that 1 MB OpenAL redistributable or the OpenAL DLL files in your game's archive
SDK Download (only DLLs and the GML scripts file): http://www.box.net/shared/3tzyqjjp9c Test kit (GM8 .gmk file, DLLs and one sample track in .ogg): http://www.box.net/shared/0jynnxfjte Compiled test kit (executable, DLLs and the sample track): http://www.box.net/shared/74rti52x9z
Simplicity If you need to play music... e_music = sga_TrackPlay( -1, "music/fight.ogg", 1, 0 );
If you need to play a sound effect... On object creation: e_fx = sga_CreateFX( "sounds/shot.wav", 0 );
On deletion/room end: sga_DestroyEmitter( e_fx );
And when you need to trigger the effect: sga_PlayFX( e_fx );
There are, of course, some tiny details that make this audio DLL good for other kinds of sound effect/music control but this a very simple usage example that almost everyone probably has seen sometime.
The Design - This is an emitter-based system. Which means that sound files don't get loaded into memory twice and all the emitters can (but shouldn't, due to speed limits of every normal game) play something at the same time. - To create an emitter, use the appropriate script (sga_CreateEmitter) or one of the simplification functions (sga_Create3DFX, sga_CreateFX), or sga_TrackPlay. - All emitters should be destroyed (sga_DestroyEmitter) to prevent memory leaks while the game is running but if they aren't, the DLL frees all the data automatically. - sga_Init and sga_Free must be called on game start and end, respectively. - Volume is controlled by group bit flags - each group represents a bit, bits are ORed together to influence the final volume of the emitter. - Every "flag" argument of any script is the bitwise list of groups that influence the emitter. 0 - no groups, 1 - group 1, 2 - group 2, 4 - group 3, 5(1+4) - groups 1 and 3 etc. - In sga_SetGroupVol and sga_GetGroupVol, group 0 is the master group - it controls the volume of all emitters, bit flag groups start with 1 and end with 32. Therefore this group ID is not equal to x in 1 << x (it is to 1 << (x-1) though). - sga_TrackPlay is very good for background music / voice acting as it recreates the emitter when necessary.
Licensing Use it any way you want (commercially or non-commercially), but with some tiny exceptions: it is not allowed is to misrepresent the author of the library and it's not allowed to sell it. Credit is appreciated but not required
P.S. Скоро напишу урок, как использовать именно эту библиотеку, и вообще зачем они нужны.