How can you tell when a audio file is done playing?

Started by ForeverZer0, August 25, 2010, 12:28:30 pm

Previous topic - Next topic

ForeverZer0

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?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

August 25, 2010, 12:34:01 pm #1 Last Edit: August 25, 2010, 12:38:59 pm by Blizzard
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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Zeriab

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 ^^

Blizzard

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. :/
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

SBR*

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.

Blizzard

Of course it is if you want your game to be chunky and unprofessional.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

Had the idea to have a end battle BGM play, after the ME, but before the map BGM.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Zeriab

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

*hugs*