GMFMODSimple v4.28.09cb (Last Update April 16 2011 11:50 PM)
Using:
FMOD Sound System, copyright © Firelight Technologies Pty, Ltd., 1994-2010.
FMOD Ex API version: v4.28.09
Licensing:
Detailed Licensing Information Here
Problems
P: It dont Work Right!!! Sounds weird, skips, lags, no 3d, no effects...
A: You forget to call FMODUpdate() each end step. 80% of the posts here are about this.
P: Some functions dont work. Pause, change volume, set position, mute
A: Many functions are instance based and you passed a sound to them. When you SoundPlay a sound, remember to store the instance, remember to use the instance when the function name indicates it. 20% of the posts here are about this.
GM81. problems, see here
http://gmc.yoyogames...dpost&p=3771535
Download
GMFMODSimpleDemo on SkyDrive
User Build Support
GM::Studio Extension
Includes:
Gmfmodesimpledemo.gm6 merge file
Fmodex.dll
Gmfmodsimple.dll
Gmfmodsimple dll source code
Sound encryption program
Sounds, music and encrypted examples
Gmfmodsimpledemo.exe (vista compatible) demo
GM Functions Replacement
GMFnWrapper.gml in the Zip
For people who don't want to translate all their sound_play/add/delete calls to FMOD equivalent in their code. This function set replaces GM's functions. They call FMOD functions so little is needed to do but drop the SampleSoundController in the boot room and call the init function. You still need to convert your GMK sounds to files (See comments in the init function)
Detailed explanation here...
Latest News:
UPDATE 4.28.09cb
UPDATE 4.28.09 + GM8 Patch
UPDATE 4.28.0
UPDATE 4.26.0
midi tag for karaoke
UPDATE 1.9.9
FMOD 4.22.01
Latest FMOD version update
Demo Updated
Parameterized effects
Microphone
Pitch Detection in MicObj and MicDraw in demo
Fast Spectrum/Wave Data Fetch using ds list
3d FPS Setup
Products and examples using FMODSimple.dll
Visual Music For Web Streaming (Does not use current FMOD), Has source.
PLEASE READ the Known Problems and Questions script in the scripts folder before posting any problems
Feature Overview:
See my top ten best used features here
Also Link To FMOD Feature List
- Supports all popular file types (excluding DRM type files like mp4)
- This system allows playing the same sound at different settings and coordinates
- This system supports Doppler effect and frequency changes ('bullet speed' sound)
- This system supports 2d distance relative sounds (directional emulation optional)
- This system supports 3d relative sounds
- This system allows playing sound at x,y,z coordinates in the room
- This system allows for hundreds of sounds 'active' in the room
- This system supports sound blocking to block or fade sounds behind walls (in a 3d sound setup)
- This system allows you to load sounds from file into your game
- This system allows encryption of sound files to protect your assets
- This system allows controlling volume for sounds, instances, and groups; The following 4 groups are available
- priority (most important group), effects, ambient music and ambient effects
- Mute, pause your sounds or sound groups
- Get sound data form paying sound or sound groups such as wave and spectrum
- Suitable for top down and platform games (on default) and 3d fps games though it requires work from your part to rotate the players 'ears'
- This system replaces the GM native sound system though it should not interfere with it (on most cards)
- This system plays sounds better than GM's native sound system
- This system allows playing files over the web (and possibly webcasts... not tested)
- This system should provide speaker support all the way to 5.1 and possibly higher sound setup (If you have a 5.1 surround setup, please inform me if it does not work right)
- Complete control of where/how the sounds play in the 3d world or over the skeakers.
- Fast playing for ogg, mp3 and other compressed sound when streamed, less memory usage.
- Fast no delay rewind of looped sounds. (Requires Loop Points for files other than wav)
- Change the volume or even mute MIDI/MOD/S3M/XM/IT instrument tracks one track at a time.
- Tweak each sound effect for the playing instance or the group.
You will find an equivalent similar FMOD function for most of GM's sound functions though some functions are 'sound' relative while others are sound 'instance' relative
How To:
Make This Work in GM Studio
Equalizer example
Get The Spectrum and Wave Data
Properly Looping Compressed Songs (mp3/ogg)
Fixing Left to right cross over transition in top down setup
How to play music backwards
How to encrypt sounds
How to Add Parameterized Effects in your game
How to extract tags from a sound
How to display karaoke lyrics
Resolve odd happening, like sound freaking out or crashes
Error defining an external function
Support Game Saving/Loading
Speaker Vibrate
Convert Values the dB
Play music off the web
Try loading in a new tab or new window if it's reloading this page when you click
Playing sounds is as easy are 1 2 3
- Init System
- Load sound (once)
- Play sound - and let included controller object handle the rest
Playing 3d sounds is almost as easy
- Init system
- Load sound (once)
- set range (once)
- play sound (looped) at x,y,(z) (many times, many places)
- place listener(s) at x,y,(z)- and let incuded controller object handle the rest
How to use, Detailed Setup:
- Download the GMFMODSimpleDemo.zip
- Unzip in on your PC
- Copy the 2 DLLs to your game project folder
- Use the Merge Feature and Merge with GMFMODSimpleDemo.gm6
- Make a BOOT Room, A room that will never be accessed again
- Set the BOOT Room as you start up room
- Drop a FMODSampleControllerObj in that room
- Use the sample controller game start to load your sounds and other event to control global music
- Use the room code button an type room_goto_next(). The BOOT room ensures everything is loaded before you attempt to play a sound, Useful if you play sound in the create event of some objects.
- The next room should be your own game/menu room
- Tip, keep everything until your game is complete. Then you can delete all the Demo Folders in the resource list.
- Tip, use the sample objects included in the Sample folder, I've included most commonly used objects.
Simplified, this is how the system works:
//////////////////////
//Simple setup
//On Game Start
LoadFMOD();
FMODinit(100);
//using a password
//FMODSetPassword("password");
//To load sounds
//game background music
global.bkMusic = FMODSoundAdd("bkmusic.mid");
FMODSoundSetGroup(global.bkMusic,3);
//To set the volume to 80%
FMODSoundSetMaxVolume(global.bkMusic,.8);
//To load a special effect
global.gunshot = FMODSoundAdd("gunshot.wav");
FMODSoundSetGroup(global.gunshot,2);//On Room Start FMODSoundLoop(global.bkMusic);
//On Sound Controller end Step FMODUpdate();
//On Player Fire Gun FMODSoundPlay(global.gunshot);
//On room end FMODAllStop();
//On Game End //to free the sounds FMODSoundFree(global.bkMusic); FMODSoundFree(global.gunshot); //to free the system FMODfree(); UnloadFMOD(); //Simple setup end ////////////////////////
Must read
HowToUse Script for common examples in the merge file
Known Problems and Questions Script in the merge file
Complete API (Does not seem that simple anymore, but you don't need to know most of these)
Game Start/End
- LoadFMOD -Load dll, define API
- UnloadFMOD -Unload DLL
- FMODinit -Init Sound system and defines how many sounds can play at the same time and if web streaming is used
- FMODfree -Free the system
EndStep
- FMODUpdate -Update the system every end step, a MUST
Adding Sounds Resources
- FMODSoundAdd -Add a sound resource
- FMODSoundFree -Free a sound resource
- FMODSoundSetGroup -Set the play group
- FMODSoundSetMaxVolume -Set the max volume
- FMODSoundGetMaxVolume - Get
- FMODSoundGetMaxDist -Get the max 3d audible distance
- FMODSoundSetEffects -Add sound effect (like GM)
- FMODSoundAddEffect Add other sound effects
- FMODSoundSet3dMinMaxDistance -Set the audible 3d distances
- FMODSoundSet3dDopplerMax -Set the doppler amplification
- FMODSoundSet3dCone -set the playing cone
- FMODSoundGetNumChannels -Get if sound is mono, stereo, or other
- FMODSoundGetLength -Get the length in millisecs
- FMODSoundSetLoopCount -Sets the loop count
- FMODSoundGetLoopCount - Get
- FMODSoundSetLoopPoints -Set where the sound starts and ends a loop
- FMODSoundGetMusicNumChannels -Get the number of midi tracks
- *1*FMODSoundGetMusicChannelVolume -Get the midi track volume
- *1*FMODSoundSetMusicChannelVolume -Set the midi track volume
*1* These APIs will allow you to change the volume or even mute MIDI/MOD/S3M/XM/IT instrument tracks one track at a time. All playing instance will be affected, this can be done while a sound is playing
Playing Sounds
- FMODSoundPlay -Play a sound (Like GM)
- FMODSoundLoop -Loop a sound (Like GM)
- FMODSoundPlay3d -Play a 3d sound
- FMODSoundLoop3d -Loop a 3d sound
Sound Instances
- FMODInstanceStop -Stops a playing sound instance
- FMODInstanceGetSound -Get the sound resource ID from the instance
- FMODInstanceIsPlaying -Is playing (like GM)
- FMODInstanceSetVolume -Set the instance volume
- FMODInstanceGetVolume - Get
- FMODInstanceSetFrequency -Set the frequency (bullet time)
- FMODInstanceGetFrequency - Get
- FMODInstanceSetMuted -Set Mute
- FMODInstanceGetMuted - Get
- FMODInstanceSetPaused -Set Pause
- FMODInstanceGetPaused - Get
- FMODInstanceSetPosition -Set playing position
- FMODInstanceGetPosition - Get
- FMODInstanceSetPan -Pan left right
- FMODInstanceGetPan - Get
- FMODInstanceSetLoopCount -Like sound version but only for this instance
- FMODInstanceGetLoopCount - get
- FMODInstanceSet3dConeOrientation -Like sound version but for this instance
- FMODInstanceSet3dPosition -Set 3d position in the 3d world
- FMODInstanceFadeVolume -Fade volume to a value
- FMODInstanceFadeFrequency -Fade frequency to a value
- FMODInstanceFadePan -Pan towards a value
- FMODInstanceSet3dMinMaxDistance -Like for sound but only this instance
- FMODInstanceSet3dDopplerMax -Ditto Doppler
- FMODInstanceSet3dCone -Ditto cone
- FMODInstanceGetMaxDist -Ditto audibility distance
- FMODInstanceGetWaveSnapshot -get wave data
- FMODInstanceGetSpectrumSnapshot -ditto spectrum
- FMODInstanceGetWaveSnapshot2 -another method
- FMODInstanceGetSpectrumSnapshot2 -another method
- FMODInstanceSoundGetLength -get the length of the sound of the playing instance
- FMODInstanceSetLoopPoints -same a sound version but for this instance
- FMODInstanceGetAudibility -Get the audibility, 0 if too far to hear
- FMODInstanceSetSpeakerMix -Complete control over where the sound plays in a 5.1/7.1 setup
- FMODInstanceSet3DPanLevel -Dynamically change 3d sound from position relative (stereo) to distance only
- FMODInstanceGet3DPanLevel - Get
- FMODInstanceSet3DSpread -Set the amount of 3d stereo effect the instance has, from intense to little
- FMODInstanceGet3DSpread - Get
- FMODInstanceSetPitch -Set frequency of the instance whitout needing to know what the original frequency was
- FMODInstanceGetPitch - Get
Groups
- FMODAllStop -Stop everything
- FMODGroupStop -Stop all in this group
- FMODMasterSetVolume -Set master volume
- FMODGroupSetVolume -Set group volume
- FMODGroupGetVolume - Get
- FMODGroupSetPitch -Set group pitch (changes all playing sounds in the group)
- FMODGroupGetPitch - Get
- FMODGroupSetPaused -Pause the playing instance in groups
- FMODGroupGetPaused - Get
- FMODGroupSetMuted - Mute
- FMODGroupGetMuted - get
- FMODGroupSetFrequency -Changes the frequency of the group (use pitch instead)
- FMODGroupSetPan -Set the group pan
- FMODGroupFadeVolume -Fade the volume to a value
- FMODGroupFadePitch -Ditto for pitch
- FMODGroupFadePan -and pan
- FMODGroupGetWaveSnapshot -Get the data, assembled from all instances playing in the group
- FMODGroupGetSpectrumSnapshot -Ditto spectrum
- FMODGroupGetWaveSnapshot2 -Another method
- FMODGroupGetSpectrumSnapshot2 -Another method
Listener
- FMODListenerSetNumber -Set the number of player on this PC
- FMODListenerSet3dPosition -Set the players hears position
- FMODListenerSet3dPositionEx -Complete control
- FMODListenerHearsDistanceOnly -Distance only or add a sense of direction to the sound position
- FMODSetDopplerFPS -Like for a moving car
- FMODSetWorldScale -Set the units used for real time Doppler, 1 pixel = 1 meter is default
Password
- FMODSetPassword -Set the decryption password
Use the included encryption application to encrypt your sound or included dll API
Blockers
- FMODBlockersInit -Init the sound blocking system
- FMODBlockersFree -Free the blocking system
- FMODBlockerAddGMObjects -Add walls in the system from GM instances
- FMODBlockerAdd -Add a blocker
- FMODBlockerSet3dPosition -Move a blocker
- FMODBlockerSet3dOrientation - Rotate
- FMODBlockerSet3dScale - Scale
- FMODBlockerSetEnabled - Enable, turn ON/OFF
- FMODBlockerGetEnabled - Get
- FMODBlockerSetStrength -Amount of sound reduction when blocking 0-none to 1 full)
- FMODBlockerGetStrength - Get
Dynamic Effects
- FMODInstanceAddEffect -Like Sound Effect but only for instance
- FMODGroupAddEffect -For group
- FMODEffectFree -Free effect
- FMODEffectGetActive - get effect active
- FMODEffectSetActive - set effect active
- FMODEffectGetBypass - get effect bypass (mute)
- FMODEffectSetBypass - set effect bypass (mute)
- FMODEffectGetDefaultPan - get effect pan
- FMODEffectSetDefaultPan - set effect pan
- FMODEffectGetDefaultVol - get effect volume
- FMODEffectSetDefaultVol - set effect volume
- FMODEffectGetDefaultFr - get effect frequency
- FMODEffectSetDefaultFr - set effect frequency
- FMODEffectGetNumParams - get effect parameter count
- FMODEffectGetParamValue - get effect param value
- FMODEffectSetParamValue - set effect param value
- FMODEffectGetParamMin - get min value
- FMODEffectGetParamMax - get max value
- FMODEffectGetParamValueStr - get the value in string format
- FMODEffectGetParamName - get param name
- FMODEffectGetParamLabel - get param label
- FMODEffectGetParamDesc - get param description
- FMODEffectGetSpeakerActive - get effect speaker active
- FMODEffectSetSpeakerActive - set effect speaker active
- FMODEffectReset - reset effect
Web Streams
- FMODSoundAddAsyncStream -Connect to server to get sound
- FMODSoundAsyncReady -Is sound ready to be instanciated, Can I SoundPlay() it
- FMODInstanceAsyncOK -While playing, am I still getting data, server error?
- FMODServerError -Server error
Tags
- FMODGetTagData -Get the data of a tag, like artist name
- FMODGetTagName -Is the tag €œARTIST€ or €œDESCRIPTION€Â, for example
- FMODInstanceGetNextTag -check if there is a tag to read
Helpers
- FMODNormalizeWaveData -Makes the largest data vale a 1 and adjust the rest to match
- FMODNormalizeSpectrumData - Ditto
- FMODSpectrumSetSnapshotType -Sets how to get the spectrum
- FMODGetSnapshotEntry -Get a single data entry of a snapshot
- FMODGetSpectrumBuffer -Fill a string with data
- FMODGetWaveBuffer - Ditto
- FMODEncryptFile -Encrypt a sound file
- FMODUpdateTakeOverWhileLocked -Take over FMODUpdate while in the help window or file_open dialog
- FMODUpdateTakeOverDone - Done
- FMODSnapShotToDsList- Grab the data feteched with GetSpectrumData and tranfer it to a ds list
Microphone
- FMODCreateSoundFromMicInput -Associate a sound to the default microphone
- FMODMicStart-Starts the microphone and returns a instance
- FMODMicStop -Stops the recording
Debugging
- FMODGetNumInstances -Number of active playing sound instances
- FMODSoundIsStreamed -Is sound streamed
- FMODSoundIs3d -Is sound 3d
- FMODSoundInstanciate -Generic play, only I know how it works, do not use
- FMODErrorStr -Convert error value to string
- FMODGetLastError -Error of last API call
FMODSimplePasswordProtect
This app will allow you to encrypt sound files, You can multi-select files to encrypt. Start the program, select the files, clicl opne. The app will ask for a password (in another file dialog, sorry, the compiler I use does not compile dialog resources under Vista). The encrypted files will be created in a sub folder in the directory where you selected the files from.
Supported File Types:
- AIFF - (Audio Interchange File Format)
- ASF - (Advanced Streaming format, includes support for the audio tracks in video streams)
- ASX - (playlist format - contains links to other audio files. To access contents, the FMOD Ex tag API is used)
- DLS - (DownLoadable Sound format for midi playback. Can also be used as a stand alone container format in FMOD)
- FLAC - (Lossless compression codec)
- FSB - (FMOD sample bank format generated by FSBank and FMOD designer tool)
- IT - (Impulse tracker sequenced mod format. FMOD Ex also fully supports resonant filters in .IT files, and the per channel or per instrument echo effect send, that can be enabled in ModPlug Tracker. This is cross platform effect support and does not require DirectX like other libraries do.)
- M3U - (playlist format - contains links to other audio files. To access contents, the FMOD Ex tag API is used)
- MID - MIDI using operating system or custom DLS patches.
- MOD - (Protracker / Fasttracker and others sequenced mod format)
- MP2 - (MPEG I/II Layer 2)
- MP3 - (MPEG I/II Layer 3, including VBR support)
- OGG - (Ogg Vorbis format)
- PLS - (playlist format - contains links to other audio files. To access contents, the FMOD Ex tag API is used)
- RAW - (Raw file format support. The user can specify the number of channels, bitdepth, format etc)
- S3M - (ScreamTracker 3 sequenced mod format)
- VAG - (PS2 / PSP format, playable on all platforms!)
- WAV - (Microsoft Wave files, inlcluding compressed wavs. PCM, MP3 and IMA ADPCM compressed wav files are supported across all platforms in FMOD Ex, and other compression formats are supported via windows codecs on that platform).
- WAX - (playlist format - contains links to other audio files. To access contents, the FMOD Ex tag API is used)
- WMA - (Windows Media Audio format)
- XM - (FastTracker 2 sequenced format)
- XMA - (Xbox 360 only)[/quote]
NOTE: Some formats may not be directly supported by my dll such as formats that specify a play list.
Edited by icuurd12b42, 30 April 2013 - 09:20 PM.









