ZFGC

Resources => Audio => Topic started by: BlazeBigBang on October 20, 2012, 02:15:02 am

Title: Looping sound
Post by: BlazeBigBang on October 20, 2012, 02:15:02 am
So, I need to loop a sound for the game I'm doing. Mostly, because there's a part at the beginning that I want not to be repeated, but I don't know how. Could someone tell me how?

EDIT: I'm using Wavosaur, Goldwave and Audacity.
Title: Re: Looping sound
Post by: BlazeBigBang on October 20, 2012, 03:27:01 am
I kind of was able to loop it, but when I open it in GM8 it doesn't loop. Here is the link for anyone who'd like to see it. Is the "In the Fields" theme from Spirit Tracks:

http://soundcloud.com/user918608133/in-the-fields-looped (http://soundcloud.com/user918608133/in-the-fields-looped)
Title: Re: Looping sound
Post by: Arcaith on October 21, 2012, 10:13:22 am
The best way to loop a track is to have two files, the start up to the point where the loop starts, and then segue straight into a different file of the part that loops.
Title: Re: Looping sound
Post by: Wasabi on October 21, 2012, 12:07:13 pm
The best way to loop a track is to have two files, the start up to the point where the loop starts, and then segue straight into a different file of the part that loops.
Yep, this. If you're using GM, I'd suggest looking at an extension or DLL that can play mp3/ogg from a file. Usually these have the ability to read the current position of the song, so when it gets to the end of the 'intro' file it starts playing the main one in a loop mode (which is also usually provided).
Title: Re: Looping sound
Post by: BlazeBigBang on October 21, 2012, 12:48:46 pm
Right now, I'm using Wavosaur, because is the only one that GM accepts as an external tool. What you're telling me to do is to have the file with the song, and then another file in which is the part I want to loop? How do I do that? I mean, I know to copy a part of the song, but I don't know how to add another song at the end, and all that.
Title: Re: Looping sound
Post by: Wasabi on October 22, 2012, 01:48:24 am
Well, what you do is load up the first part in your game, start playing that, then have some code that checks if the end of the first song has been reached yet. If it has, start playing the looped part. And I'm not talking about external tools. You want to use a DLL or extension to have your game load the music files when someone plays it. It'll also decrease loading times and filesize of the executable, never put mp3/ogg files inside the game :P
Title: Re: Looping sound
Post by: BlazeBigBang on October 22, 2012, 11:35:17 am
Oh, I see. Thanks for your help  :D!

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved