Loop MP3 Music
#1
Loop MP3 Music
by GubiD
Apr 27, 2008

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given.


Introduction
Ever want to have better audio but to still have loop functionality? This script will allow you to configure by song name a start/begin loop/end loop position that will allow you to achive looping regardless the file format. Be it MID, MP3, OGG, or WAV.


The Script


Instructions
At line 35 you start "case @name", each when statement below there should contain the file name of the song you are trying to play. (Note: All song files must be in the Audio\BGM folder!)
When a song is specified "When 035-Dungeon01", then you can define 4 things: type, start, loop, fin

Type:
Type is the type of song it is. This generally doesn't matter UNLESS you are calling a "battle" during a "dungeon". When a "Battle" is called from a "Dungeon", the "Dungeon" is paused and will later be resumed when called again.

Start:
This is the location to start the song. If you want to skip the first 10 seconds, then you are more than welcome to do so.

Loop:
This will be the location in which the song resumes when FIN in reached.

Fin:
This is the "end of song" or "end of loop". When reached, this will "rewind" the song to "loop" position. If this position is exceeded because the game is inactive, it will loop when the song is complete.

If there is not a "When *" statement for the song, then it will use the default audio system and looping. Also be sure that file names specified here must contain no SPACES: 106 IGNITION = BAD, 106_IGNITION = Good
Also note that if your Windows Media Player supports the audio type, then you can update this script to use that audio type as well. Just update the "def name?" method to search for that file extension.

Note:
All time measurements are done in 1/1000 sec, so 1000 would be 1 second. Whenever the song "rewinds" it has about a .2 second rewind time.


DEMO!
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  map music continues during battle Nakate 0 2,594 08-11-2007, 01:00 PM
Last Post: Nakate
  Ending Battle Music Fix Sephirothtds 0 2,536 05-11-2007, 01:00 PM
Last Post: Sephirothtds



Users browsing this thread: 1 Guest(s)