Here are the specifications for my audio looping plugin. I will be using a file-based format.
Setting up your data
This is how you will set it up.
Start by downloading the "template" I provide, which will look like this:
Code:
Profile Name,Audio Folder,Audio Name,Measure Unit,Loop Start,Loop Duration,Start Position
Battle_normal,Bgm,Battle1,samples,44100,4321393,0
Profile name is the identifier for the entry. You will use this in the game to set up additional audio properties.
Audio folder is the name of the folder the music is found. This probably will always be BGM unless you want to loop ME or BGS.
I only include this in case people want more than just bgm looping.
The Audio Name is the exact name of the file, without the extension
Measure Unit will either be "samples" or "seconds"
Loop Start is the position in the track that the loop will begin. The unit will be in either samples or seconds depending on what you chose for the measure unit.
Loop Duration is how long the loop section is. The unit will be in either samples or seconds depending on what you chose for the measure unit.
The Start Position is where the song will begin. So for example, if this song should always start at the loop start, or anywhere you want. Again, unit is based on your measure unit.
Providing Input to Plugin
The expected input format will be JSON, but you can build it in a spreadsheet, export to CSV, and then convert the CSV to JSON using a plethora of tools available
Like this:
http://www.csvjson.com/csv2json
After building your CSV file, you would run it through the CSV to JSON tools and get this
Code:
[
{
"Profile Name": "Battle_normal",
"Audio Folder": "Bgm",
"Audio Name": "Battle1",
"Measure Unit": "samples",
"Loop Start": 44100,
"Loop Duration": 4321393,
"Start Position": 0
}
]
Using it in your project
Let's say you wanted to use a specific audio profile for your battle music for a specific boss battle.
You would make the following plugin command
Code:
load_audio_profile NAME_OF_AUDIO_PROFILE
To load the appropriate profile.
Then, the next time the audio plays, it will run with your new profile.
[doublepost=1447471908,1447443960][/doublepost]Finishing up. Supports custom start offset and looping. Multiple profiles can be set up for the same track if needed.