MODULE: ambient sounds, ambient loops

Started by Monsieur OUXX, Wed 03/07/2013 23:44:33

Previous topic - Next topic

Monsieur OUXX

WHAT DOES IT DO
      It allows you to play any sound so that it repeats smoothly,
      thus allowing you to transform any sound effect into an ambient loop.

Quote

     
      Note that it will work better if the sound is rather uniform (no
      recognizable repeating sound in it) and not too short.
      For example, if you have a "storm" sound effect, avoid having
      one outrageously recognizable thunderclap sound right in the middle of
      your ridiculously short loop.
     
    USE:
   
    Example :
      aSound1.Play_Ambient(); //this plays aSound1 in a smooth loop

      aSound1.Stop_Ambient(); // stops aSound1
      Stop_Ambient_All(); //stops all ambiant sounds
     
    LIMITATIONS
      You can play up to 10 ambiant sounds simultaneously. change macro
      MAX_AMBIENTS to increase the limit.Please note that the real limit
      is the number of channels. There is a need of 2 channels per ambiant sound.

WHAT DOES IT NOT DO
    No handling of spanning
    Plays the sounds on the first found channel, with priority 1
    => You can easily tweak the module to add those refinements.

Compatibility :
    made in 3.2.1 (not tested below)
    Works with "enforce new style audio scripting" to true.


Download (version 1.0)
 

Ghost

That sounds pretty perfect for weather effects. I'll need to try it out but I already like the premise. Thanks a bunch!

Phemar

Nice idea. Why is the file a .0 extension and not a .scm? Also, there's a typo in 'int GetSlot', you wrote 'mabient' instead of 'ambient'. And ambient is spelled with an 'e', not an 'a' :D

Monsieur OUXX

#3
Quote from: Phemar on Thu 04/07/2013 11:00:45
Nice idea. Why is the file a .0 extension and not a .scm?

That's because when you type "module_1.0" in the export field of AGS, it considers that ".0" is the extension, and doesn't add ".scm" at the end. Don't blame me ;)


Quote from: Phemar on Thu 04/07/2013 11:00:45
Also, there's a typo in 'int GetSlot', you wrote 'mabient' instead of 'ambient'.

Does that prevent the module from working? I'm pretty sure I exported it straight from the demo!

Quote from: Phemar on Thu 04/07/2013 11:00:45
And ambient is spelled with an 'e', not an 'a' :D
Oh well, I spelt it with an "e" almost everywhere, so I'll live with it.  Blame the English language, that puts an "a" to "ambiance", but an "e" to "ambient". Makes no sense!!!111!!!11 ;)
 

SMF spam blocked by CleanTalk