FMOD Ex Audio
Version: 1.51
Introduction
A few years ago, Hiretsukan (Kevin Gadd) wrote an FMOD binding script for RGSS, which allowed RPG Maker XP to use the FMOD audio library for BGM playback, allowing access to many more file formats (including streamed OGG, AAC, WMA, IT, XM, MOD, etc.). It was a great script that could be easily extended. You could find his original script here. Still, the script was limited; it was focused on playing BGMs, and didn't support Music or Sound Effects, it also didn't support fading. Furthermore, some more features were needed such as remembering BGM position after battle and with the BGM/BGS memorize event command, and setting loop points for files other than MIDIs. With that in mind, I started modifying the script to add more and more features. The bulk of the script is still Hiretsukan's, but it's now much more accessible; I used it to rewrite the built-in Audio module. I also fully documented the script, fixed some bugs, and added position and loop point support.
Features
Screenshots
It's an Audio script, so just try demo.
Demo
DEMO LINK
Check the script called 'FmodEx *' at the top of the script sections list for instructions on how to use it (also check 'Game_System *' and 'Other Classes *' at the bottom for the other classes)
Script
Just download the demo.
Instructions
Directly from demo:
FAQ
Feel free to ask any questions
Compatibility
Credits and Thanks
- Thanks to Hiretsukan (Kevin Gadd) for the original binding. If you'd like to credit it anyone, it's him!
Terms and Conditions
Version: 1.51
Introduction
A few years ago, Hiretsukan (Kevin Gadd) wrote an FMOD binding script for RGSS, which allowed RPG Maker XP to use the FMOD audio library for BGM playback, allowing access to many more file formats (including streamed OGG, AAC, WMA, IT, XM, MOD, etc.). It was a great script that could be easily extended. You could find his original script here. Still, the script was limited; it was focused on playing BGMs, and didn't support Music or Sound Effects, it also didn't support fading. Furthermore, some more features were needed such as remembering BGM position after battle and with the BGM/BGS memorize event command, and setting loop points for files other than MIDIs. With that in mind, I started modifying the script to add more and more features. The bulk of the script is still Hiretsukan's, but it's now much more accessible; I used it to rewrite the built-in Audio module. I also fully documented the script, fixed some bugs, and added position and loop point support.
Features
- Aside from MIDIs, WAVs, and MP3s, the script supports many new formats: Streaming OGG, AAC, WMA, IT, XM, MOD, S3M.
- Several layers of complexity with the highest being generally identical to the built-in Audio module and the lowest allowing direct access to FMOD's interface.
- Remembers position of BGM with BGM/BGS memorize event command and after battle instead of starting over.
- Ability to set loop points to any file type.
- Source code provided and well-documented, so you could easily extend it farther to harness the power of FMOD.
Screenshots
It's an Audio script, so just try demo.
Demo
DEMO LINK
Check the script called 'FmodEx *' at the top of the script sections list for instructions on how to use it (also check 'Game_System *' and 'Other Classes *' at the bottom for the other classes)
Script
Just download the demo.
Instructions
Directly from demo:
Code:
# You need to copy the file fmodex.dll to your game folder (folder where
# your Game.exe and project file are). I've provided the DLL with the
# demo, and you can also get the latest version from FMOD's official
# website ([url=http://www.fmod.org/index.php/download]http://www.fmod.org/index.php/download[/url]).
#
# There are three scripts that could be used, the real script is only
# the first one, but the other scripts are provided for convenience:
#
# FModEx
# This includes the core functionality and the Audio module
# rewrite. It's the main script and should be placed on
# top of all scripts using it. Most people would just add a
# new section above the Game_System or Game_Temp section at
# the very top of the script editor and paste script there.
# Game_System
# This script rewrites parts of the Game_System class to
# allow memorize_bgm to support remembering position,
# and to allow the play methods to take an extra parameter
# specifying position to start playing from. The last
# addition is updating the Audio class every frame.
# Add it anywhere under the Game_System script section.
# If you don't need any of these features you don't need this
# script, but you'll still need to at least call the Audio
# update methods yourself.
# Other Classes
# This is really an optional script that modifies the default
# battle system to memorize map BGM and position instead of
# starting over after the battle. Add it anywhere under
# the Scene_Battle classes.
#
# Aside from integration with RMXP's default scripts, you can use
# this script the same way you used the old Audio class You could also
# access the FMod module for more options at a lower level, such as
# setting loop points (FMod.bgm_set_loop_points(first, second) in
# milliseconds) and getting current BGS position (FMod.bgs_position) to
# name a few.
FAQ
Feel free to ask any questions
Compatibility
Code:
# This script has different levels of compatibility depending on what
# scripts you use:
#
# FModEx
# This script overwrites the Audio module, but since
# few if any other scripts would do that, it's pretty
# much compatible with the majority of other scripts
# without modifications.
# Game_System
# The following methods of Game_System are redefined:
# bgm_play, bgm_restore, bgs_play, bgs_restore
# Any other script that redefines these methods may
# not work well with this one. Most scripts wouldn't
# do that, except ones dealing with audio as well.
# I've marked the areas in the script where I made
# changes to help you resolve any conflicts
# The following methods of Game_System are aliased:
# bgm_memorize, bgs_memorize, update
# Other scripts that redefine these methods should
# be placed above the Game_System script.
# Other Classes
# The following methods of Scene_Battle are redefined:
# judge, start_phase5, update_phase5
# Any other script that redefines these methods may
# not work well with this one. Custom battle system
# scripts may do that, so you might consider not
# including the Other Classes section and just
# manually add position memorizing functionality.
# I've marked the areas in the script where I made
# changes to help you resolve any conflicts
# The following methods of Game_Temp/Scene_Map are aliased:
# Game_Temp#initialize, Scene_Map #call_battle
# Other scripts that redefine these methods should
# be placed above the Other Classes script.
#
# So in other words, FModEx is the most compatible, followed by
# Game_System, and finally the last and optional Other Classes.
# If you use a custom battle system you probably shouldn't include
# Other Classes anyway. This isn't an SDK script and I never tested
# it with the SDK. It'll probably work, but refer to SDK documentation
# for more information.
Credits and Thanks
- Thanks to Hiretsukan (Kevin Gadd) for the original binding. If you'd like to credit it anyone, it's him!
Terms and Conditions
Code:
# Use of this script is subject to the permissive BSD-like license below.
# That basically means you could use it in any way you like as long
# as you keep the following copyright and license unchanged and available,
# and don't use name of copyright holder to promote products based on
# this software. Note, however, that this license only applies to the
# script, and not to the FMOD library. For more information about FMOD
# licenses consult FMOD website: [url=http://www.fmod.org/index.php/sales]http://www.fmod.org/index.php/sales[/url]
# It's free for non-commercial use, and they provide several types
# of licenses for different types of developers.
#
# Copyright (c) 2005, Kevin Gadd
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * The name of the contributors may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY Kevin Gadd ''AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Kevin Gadd BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.