Change sound effect for Menu Open and Close?

By default, VXA uses the "OK" and "Cancel" sound effects for opening and closing the menu, but I'd rather use unique sound effects for these instances.

If anyone knows which script dictates the sound effects used here, or has a snippet of code (or even a full script) I could use to change them, I'd very much appreciate it, thank you.
Scene_Map defines #call_menu which starts with Sound.play_ok, you can replace that line with a call of any other sound that is defined in the script Sound or a direct playback instruction like this:

Ruby:
    Audio.se_play("Audio/SE/menu_open_filename.ogg", 80, 100)

Altering the closing is way more complex since it just uses #process_cancel from Window_Selectable which does a sound-playback, so when we would replace it there, every cancel-action would sound different. Instead, you'll have to add a re-define of #process_cancel inside Window_MenuCommand:

Ruby:
  def process_cancel
    Audio.se_play("Audio/SE/menu_close_filename.ogg", 80, 100)
    Input.update
    deactivate
    call_cancel_handler
  end

In both snippets, 80 is volume (RPGXP, VX and Ace set 80% as default volume when you choose a sound, just adjust between 0~100 what you need), 100 is the pitchlevel.

~炬燵あ
In database -> system tab -> sound effects
Here's a way to shorten those calls and customize the volume and pitch in game.

Ruby:
# * Sound Module Extension  * #

# * Script Calls * "

# Sound.play_menu_open
# Sound.play_menu_close
# Sound.se_volume = NewPercent
# Sound.se_pitch = NewPercent

module Sound
  MENU_OPEN = ""
  MENU_CLOSE = ""
  @se_volume = 80
  @se_pitch = 100
  extend self
  attr_accessor :se_volume, :se_pitch
  def play_menu_open
    Audio.se_play("Audio/SE/" + MENU_OPEN, @se_volume, @se_pitch)
  end

  def play_menu_close
    Audio.se_play("Audio/SE/" + MENU_CLOSE, @se_volume, @se_pitch)
  end
end
Scene_Map defines #call_menu which starts with Sound.play_ok, you can replace that line with a call of any other sound that is defined in the script Sound or a direct playback instruction like this:

Ruby:
    Audio.se_play("Audio/SE/menu_open_filename.ogg", 80, 100)

Altering the closing is way more complex since it just uses #process_cancel from Window_Selectable which does a sound-playback, so when we would replace it there, every cancel-action would sound different. Instead, you'll have to add a re-define of #process_cancel inside Window_MenuCommand:

Ruby:
  def process_cancel
    Audio.se_play("Audio/SE/menu_close_filename.ogg", 80, 100)
    Input.update
    deactivate
    call_cancel_handler
  end

In both snippets, 80 is volume (RPGXP, VX and Ace set 80% as default volume when you choose a sound, just adjust between 0~100 what you need), 100 is the pitchlevel.

~炬燵あ
Here's a way to shorten those calls and customize the volume and pitch in game.

Ruby:
# * Sound Module Extension  * #

# * Script Calls * "

# Sound.play_menu_open
# Sound.play_menu_close
# Sound.se_volume = NewPercent
# Sound.se_pitch = NewPercent

module Sound
  MENU_OPEN = ""
  MENU_CLOSE = ""
  @se_volume = 80
  @se_pitch = 100
  extend self
  attr_accessor :se_volume, :se_pitch
  def play_menu_open
    Audio.se_play("Audio/SE/" + MENU_OPEN, @se_volume, @se_pitch)
  end

  def play_menu_close
    Audio.se_play("Audio/SE/" + MENU_CLOSE, @se_volume, @se_pitch)
  end
end
Thank you both! Works lovely 🙂
Hi, i was wondering, is there also a way to do exactly that in MV?
Necro-post notice: @lurk If OP needs the topic still, they can report it to be reopened.

Since this is the VXAce section and you’re seeking help for MV, it would be necessary to start a thread in the MV Support section.

Original thread: https://forums.rpgmakerweb.com/threads/change-sound-effect-for-menu-open-and-close.152745/