Hopefully this is what you were looking for and I'm also hoping that this is compatible with your Audio Engine:
CODE
#==============================================================================
# Title: Stop BGM When playing ME
# Version: 1.0
# Author: The Law G14
#==============================================================================
#==============================================================================
# ** Module_RPG
#------------------------------------------------------------------------------
# A module containing RPGVX Data Structures.
#==============================================================================
module RPG
#==========================================================================
==
# ** Class BGM
#==========================================================================
==
class BGM < AudioFile
#-------------------------------------------------------------------------
# * Class Variables
#-------------------------------------------------------------------------
@@last = BGM.new
#-------------------------------------------------------------------------
# * Alias Listing
#-------------------------------------------------------------------------
alias law_bgm_stop_when_me_rpg_bgm_play play
#-------------------------------------------------------------------------
# * Play
#-------------------------------------------------------------------------
def play
# Check if ME is valid
if !@name.empty?
Audio.bgm_play("Audio/BGM/" + @name, @volume, @pitch)
@@last = "Audio/BGM/" + @name
else
law_bgm_stop_when_me_rpg_bgm_play
end
end
end
#==========================================================================
==
# ** Class ME
#==========================================================================
==
class ME < AudioFile
#-------------------------------------------------------------------------
# * Alias Listing
#-------------------------------------------------------------------------
alias law_bgm_stop_when_me_rpg_me_play play
#-------------------------------------------------------------------------
# * Play
#-------------------------------------------------------------------------
def play
# Check if ME is valid
if !@name.empty?
# If so temporarily stop currently playing BGM
bgm = RPG::BGM.last
Audio.bgm_stop
# Play ME
Audio.me_play("Audio/ME/" + @name, @volume, @pitch)
# Then return back to original BGM
Audio.bgm_play(bgm.to_s)
else
# If not, return to original method
law_bgm_stop_when_me_rpg_me_play
end
end
end
end
#==============================================================================
#
# *** END OF SCRIPT ***
#
#==============================================================================
Hope this helps