Chaos Project

RPG Maker => RPG Maker Scripts => Topic started by: ForeverZer0 on August 25, 2010, 12:28:30 pm

Title: How can you tell when a audio file is done playing?
Post by: ForeverZer0 on August 25, 2010, 12:28:30 pm
I would like to know. I thought maybe trying to open and possibly using the eof? function, but I don't think that will work. Is this possible, or yet another missing ability from the Audio module?
Title: Re: How can you tell when a audio file is done playing?
Post by: Blizzard on August 25, 2010, 12:34:01 pm
Can't be done using the default audio module.

EDIT: If you want to use an external audio library, you can try XAL. http://code.google.com/p/libxal/
I just don't know how well it will work with Ruby since it was made in C++ with objects and Ruby can only use C DLLs as far as I know.
Oh, and don't use the threaded mode. It's buggy for some odd reason.
Title: Re: How can you tell when a audio file is done playing?
Post by: ForeverZer0 on August 25, 2010, 04:22:26 pm
Okay. Thanks.
Title: Re: How can you tell when a audio file is done playing?
Post by: Zeriab on August 26, 2010, 07:06:49 am
You can use an outside tool to give you the length of each audio file.
You can then map filename to length and keep track of the start to to guess at when it ends.

It isn't as perfect as a response would be from Audio, but it may suffice ^^
Title: Re: How can you tell when a audio file is done playing?
Post by: Blizzard on August 26, 2010, 07:26:29 am
It will mess up as soon as there is one single moment of pause during the game (lag, loading times, etc.) and the longer the file, the longer the offset will be. It's really not an option. Half a second wouldn't be so bad, but we're talking here probably about half a second every 10 seconds. :/
Title: Re: How can you tell when a audio file is done playing?
Post by: SBR* on August 26, 2010, 07:36:59 am
Quote from: Blizzard on August 26, 2010, 07:26:29 am
It will mess up as soon as there is one single moment of pause during the game (lag, loading times, etc.) and the longer the file, the longer the offset will be. It's really not an option. Half a second wouldn't be so bad, but we're talking here probably about half a second every 10 seconds. :/


It IS an option if Zer0 is talking about SE's and most of the ME's.
Title: Re: How can you tell when a audio file is done playing?
Post by: Blizzard on August 26, 2010, 09:27:27 am
Of course it is if you want your game to be chunky and unprofessional.
Title: Re: How can you tell when a audio file is done playing?
Post by: ForeverZer0 on August 26, 2010, 11:28:51 am
Had the idea to have a end battle BGM play, after the ME, but before the map BGM.
Title: Re: How can you tell when a audio file is done playing?
Post by: Zeriab on August 28, 2010, 12:11:06 pm
Quote from: Blizzard on August 26, 2010, 07:26:29 am
It will mess up as soon as there is one single moment of pause during the game (lag, loading times, etc.) and the longer the file, the longer the offset will be. It's really not an option. Half a second wouldn't be so bad, but we're talking here probably about half a second every 10 seconds. :/


Hence why I said it may suffice ^^

You can also try to see if there is an option for checking that in Cowlol's FMOD Ex Audio Module Rewrite (http://www.hbgames.org/forums/viewtopic.php?t=55486.0)

*hugs*