Jump to content

Environment Generator v3


Dicemaster Slayer
 Share

Recommended Posts

Since my recent expansion of effects will be put to use in EGv4, only the Rain/Storm theme of EG3 is available

Because of its use of balloon tips (and no OS checking yet), Environment Generator v3 requires Windows 2000/XP or higher.

Environment Generator is a standalone soundscape program. That is, it makes use of many sound effects to create an atmosphere of sound (the environment) on your computer. This is the third iteration of the project. EG1 was both huge and low-quality. EG2, a set of multiple themes, had better quality sounds, but was even larger, because I kept using the original WAV formats.

EG3 uses only mp3s, and AutoIt's SoundPlay() function to give the highest-quality environment yet. Everything is compressed into one program, which will make itself a little corner in the Temp folder, and whip up a storm, so to speak. On exit, it removes its corner.

Environment Generator's multiple sound channels is accomplished by the use of subprograms for each set of effects. In Rain/Storm, rain is given one program, looping forever. Same for wind. Then there are two channels for thunder, one distant and one nearby. Each randomly plays back a sizable repository of thunder effects.

Because my effect library was limited to rain effects, only one EG3 release is available, that of Rain and Storm. On execution, it will begin with the Rain theme. You can switch the themes via the tray menu or with CTRL+SHIFT+A. Pausing is done by doubleclicking (or open the menu) the tray or CTRL+SHIFT+S. And to exit, use the tray or CTRL+SHIFT+Q. These combinations are listed by going to tray menu -> help. You can also execute Rain with various command switches to start it with storm, or paused on rain or storm (to prevent the sudden burst of sound as everything plays at once to start).

Enough advertising. On to the release!

EG3 consists of 64 files, including scripts and subprograms. The subprograms must be compiled first, followed by the main manager program, obviously with the FileInstall paths corrected. Or just get the compiled program. Same thing.

EGv3 - Rain & Storm Download Here

Source Code + Sounds Download Here

Environment Generator v4 is in planning stages at this time. It will consist of many, many more effects spanning multiple themes, all customizable. We'll try to keep the memory usage to a minimum, but that's probably not easy when you're dealing with many sounds having to play at once, by way of multiple background programs. If anyone has a suggestion on how we could possibly overlay sounds on top of each other (sounds that will loop at different times or play randomly), please do send email.

Link to comment
Share on other sites

Seems like it's more complicated than it needs to be, but creates nice sounds :)

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Hey it's me again. I wanted to mention, I know of a DllCall that has allowed me to seamlessly loop audio, the SoundPlay function always has a bit of a pause before it's sound loops. The drawbacks are 1) I haven't been able to figure out how to make it stop looping without playing another sound and 2) it only plays WAV's. :P

Might be worth giving a try though. I'm including all the constants I've found for the function, maybe someone can find a combination that will stop the looping sound silently.

Func _SoundLoop($sSoundFile, $bLoop = True)
    Local Const $SND_ALIAS = 0x10000
    Local Const $SND_ALIAS_ID = 0x110000
    Local Const $SND_APPLICATION = 0x80
    Local Const $SND_ASYNC = 0x1
    Local Const $SND_FILENAME = 0x20000
    Local Const $SND_LOOP = 0x8
    Local Const $SND_MEMORY = 0x4
    Local Const $SND_NODEFAULT = 0x2
    Local Const $SND_NOSTOP = 0x10
    Local Const $SND_NOWAIT = 0x2000
    Local Const $SND_PURGE = 0x40
    Local Const $SND_RESOURCE = 0x40004
    Local Const $SND_SYNC = 0x0
    
    If $bLoop Then
        DllCall('winmm.dll', 'int', 'PlaySoundA', 'str', $sSoundFile, 'int', 0, 'int', BitOR($SND_ASYNC, $SND_FILENAME, $SND_LOOP))
    Else
        DllCall('winmm.dll', 'int', 'PlaySoundA', 'str', $sSoundFile, 'int', 0, 'int', $SND_FILENAME)
    EndIf
EndFunc

ToolTip('ding, ding, ding...')
_SoundLoop('c:\windows\media\ding.wav')

Sleep(3000)

ToolTip('Silence!')
_SoundLoop('stop', False)

Sleep(2000)

*Edit: Darn ":)" smiley :)

Edited by Saunders
Link to comment
Share on other sites

Oh, and I completely forgot about this, you CAN play more than one sound at a time in one script. Have a look at _SoundOpen and _SoundPlay in the Help file.

#include <Sound.au3>
$ding = _SoundOpen('c:\windows\media\ding.wav')
$tada = _SoundOpen('c:\windows\media\tada.wav')

_SoundPlay($tada, 0)
_SoundPlay($ding, 0)
Sleep(3000)
Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 1 year later...

Thanks Saunders.

;o)

(or

ps. To stop the sound, just do this..

DllCall('winmm.dll', 'int', 'PlaySoundA', 'int', 0, 'int', 0, 'int', BitOR($SND_ASYNC, $SND_PURGE))

(anything after the first null (0) appears to make no difference, but sending a purge feels good. the async is pure voodoo)

http://www.pinvoke.net/default.aspx/winmm/PlaySound.html

http://msdn.microsoft.com/en-us/library/ms712879.aspx

Edited by corz

nothing is foolproof to the sufficiently talented fool..

Link to comment
Share on other sites

  • 2 months later...

Saunders:

I'm looking for a way to queue up Midi files and have them either loop or play sequentially based upon real time keystrokes so I'm interested in what you guys have done here. The winmm.dll WILL play midi files instead of wav if you change the "PlaySoundA" parameter to "mciExecute". Unfortunately, my test program crashes a few seconds after the midi starts playing and I'm not sure why, but it's a start!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...