blub posted a similar question, but I didn't want to hijack his thread so here goes.
Is it stupid to play all sound effects from external files in game with the built in sound engine in MMF2?
Printable View
blub posted a similar question, but I didn't want to hijack his thread so here goes.
Is it stupid to play all sound effects from external files in game with the built in sound engine in MMF2?
Why would it be 'stupid'?
Is it going to lag the application a lot due to factors like hard drive read speed or MMF2 inherently lagging when a sound is played or something?
I believe it would lag the game big time and IMO not a good idea to do,..but then again I never tried it.
No. I have all my sound effects and BGM done externally using the Sound Player + File Folder Object extensions. It's really simple. They are all parsed through the file-folder object and added into the sound player object's cache. There is no lag as far as I'm concerned when playing them.
Start of Frame
--> Start Browsing Folder: "sfx path" (ID:0)
(Browse the path of wherever your sounds are located)
On File while browsing loop
+ Lower$(Right$(getCurrentBrowsedPath$( "File-Folder object" ), 3)) = "ogg"
--> Add Sound "" from file getCurrentBrowsedPath( "File-Folder object" )
(This event checks if string of the file and detects if it has the "ogg" extension on it, then adds it to the sound player.)
Then you'd use the Sound Player object like MMF2's default sound. Example;
Start of Frame
-->play "sample1" on channel 0
I choose this method because I had sound clipping problems with MMF2's sound channel detection. I don't remember the exact details but I love having external sfx.
Wow oasuke! This is great to know. Thanks for posting this. I will give this a go on my next game.
OK this sounds cool but where do I get the sound player object? I don't see it anywhere.
Wouldn't using external sounds actually be slightly faster than storing them internally in the EXE (or other final product)? I imagine they just have to be extracted, resulting in the file being external anyways. Is this correct?
Nah. The sound file is extracted from the EXE directly into the RAM, from where it can be played directly whenever you need to.
Thanks for linking it to me, but unfortunately I can't use it because I require being able to test if a specific channel is playing or not.
Yes you can. Just use the extension and use the normal action to check if the channel is playing or not.
Oh I see, so it integrates with the built in sound system. Very nice. Very nice indeed. Thanks.
Now the question is, where is the File Folder object? I thought I had it but I don't.
See my signature. :)