[XP][VX][VXA] MCI Audio Player

Started by ForeverZer0, April 29, 2012, 05:58:53 pm

Previous topic - Next topic

LiTTleDRAgo

---- deleted ----

I installed that codec and now it works
but I still think the dependancy on another codec than K-Lite is annoying

ForeverZer0

You don't have to use it.
It works by using the operating system's player, so there isn't much that can be done about it. There are some other codec packs available out there. I'll take a look and see if I can find one that includes a Vorbis filter by default.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

ForeverZer0

Updated script and demo to v.1.2, which adds the following features:

  • Fixed incorrect filepaths that mixed forward and backward slashes

  • Fixed a bug that would cause full paths to files not to play sometimes

  • Added an enumerator for iterating Audio mixers ("Audio.each_mixer")

  • Added methods to Game_System for memorizing/restoring audio



Also added a small plugin that automatically memorizes/restores BGM and BGS before and after battle.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G

Hey Zer0, the whole VX and VX Ace library issues, do you think they could have anything to do with the fact that VX and VX Ace don't support multiple RTP's?

ForeverZer0

Possibly.

I actually found an easier solution to the problem in a small side project I am working on at the moment in C#. For some strange reason, I couldn't get the RGSSGetRtpPath to work with P/Invoke in C#, so I simply decided to read the registry instead. I could update this to the same. To be quite honest, I didn't even realize the VX and VXA didn't support multiple RTP's, that's how bad my ignorance of those two inferior engines is. :P

I'm about ready for bed, but I'll make a quick update tomorrow with the appropriate fixes.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

LiTTleDRAgo

October 18, 2012, 08:10:30 am #25 Last Edit: October 20, 2012, 09:05:21 am by LiTTleDRAgo
script error wrong argument

Quote
   #---------------------------------------------------------------------------
   # * Use MCI Player play function
   #---------------------------------------------------------------------------
   alias mci_se_play se_play
   def se_play(filename, volume = 100, pitch = 100, start = 0)
     if MCI_DEFAULT
       mixer_play('SE', filename, volume, pitch, false, start)
     elsif RPG_VERSION == 2
       mci_se_play(filename, volume, pitch, start)
     else
       mci_se_play(filename, volume, pitch, start)
     end
   end


that error will occurs if you play any SE with MCI_DEFAULT set to false

Quotemodule Audio

  # Set true/false if the MCI Player should be the default audio controller. It
  # will maintain all the same functionality as the standard control, and all
  # normal calls to the Audio module will work as normal, but it will also
  # extend the its functionality. If false, RMXP's standard library will be used
  # and this player will only be used for custom mixers.
  MCI_DEFAULT = false

finalholylight

October 20, 2012, 12:14:21 am #26 Last Edit: October 20, 2012, 05:51:20 am by finalholylight
Can this script set loop point for BGM ? , example for a BGM that have a prelude, I want to make a loop point that skip prelude when BGM loop, like this : start with 1 2 3 4 5 , then loop 3 4 5 and loop 3 4 5 ... , skip 1 2.

KK20

    #---------------------------------------------------------------------------
    # * Began playback on the mixer
    #     filename  : The name of the file to play
    #     volume    : The volume to play the file at
    #     speed     : The speed to play the the fule at
    #     repeat    : Flag if playback should loop after done playing
    #     start     : The position, in milliseconds, to begin playback at
    #---------------------------------------------------------------------------
    def play(filename, volume = 100, speed = 100, repeat = false, start = 0)
Looks like it to me. When calling the method play, set the parameter start to the position in the song that skips the intro.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

newold

Error after the intro in the demo:



This script requires a specific audio codec?

gerrtunk

December 20, 2012, 06:49:20 am #29 Last Edit: December 20, 2012, 06:51:14 am by gerrtunk
Hi im who suggested the audio plugin for continue map music in rpgmxunlimited but that page is off for now.
I have to report a suggetion to that plugin: the map music start when the sound of the battle end starts and it sounds very rare. Not trully a bug but a thing to improve maybe?

And the other bug. I found also the  problem that the sounds of the rtp arent working. I think i did have some problems with some songs repetaing, others not, etc and then installed the codec pack you posted here.

Now it seems to work all, but the problem is that exist a latency in the game when a sound or music is started. When im moving in the map i dont see it because no sounds or the music is already started but if im in the main menu every time i move in it i find a delay for the systems sounds. It dont kill it absolutely but i think is noticable... i moved the cursor in the menu in a two projects, one with the script and other without it and new, and the speed of moving in the menu is better in the new and without the script.

Anyway it dont kill the thing but...

About the plugins is a problem of course to need to install this... maybe we can put a option so it can read directly the DLLS from a directory of the game?

If not i will or make a installer that also install it or put the executable,small, with the game and explaing the need of the codec install, in the game.

Wecoc

January 05, 2013, 05:31:31 pm #30 Last Edit: January 05, 2013, 05:36:38 pm by Wecoc
I'm using the 1.2 version of this script on XP but I found a problem with that. Well, without the script, when you are on a map with a current music and you teleport to another map, if the other map's music is the same it continues. But with the script it restarts.

I would like to make an iMuse easy engine with that script (I believe it could be possible) but with that bug I can't...

gerrtunk

For that i created a plugin that fixes the problem. Note that it isnt fully tested and it dont changue sound for now but is a lot easy to make that. It have a turn on off function also. You can use it and forevezer can plug it in the script just getting credits.

=begin
Este script hace que las musicas del mapa no se reinicen cuando ya esta sonando
la misma cancion. Osea, imaginate que en el mapa 1 y 2 tienes las mismas canciones,
si vas del mapa 1 al 2 la cancion se reinicia al entrar aqui dando un salto
de continuidad. Este script elimina ese problema.

NOTA QUE queda implementar los sondios bgs

This  fixes a problem
=end
module Wep
  No_restart_map_music_mode = true
end

class Game_Map
#--------------------------------------------------------------------------
  # * Get Map Data
  #--------------------------------------------------------------------------
  def bgm
    return @map.bgm
  end
end

class Scene_Map
#--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      Graphics.transition(20)
    end
   
   
      # Run automatic change for BGM and BGS set on the map
      #p "map test bgm bug no reload", $game_system.playing_bgm, $game_map.bgm, Wep::No_restart_map_music_mode
      # Solo si la musica actual no es igual a la nueva y no se esta
      # en modo reiniciar musica se reinciiar la musica
      if Wep::No_restart_map_music_mode
        #p "mode restart actiu"
        # Si no te cap reproduitnse comporta normal
        if  $game_system.playing_bgm == nil # pensar or $game_map.bgm == nil
          $game_map.autoplay
        elsif $game_system.playing_bgm.name != $game_map.bgm.name
          $game_map.autoplay
        end
      else
        #p "noemal"
        $game_map.autoplay
      end
   
      #p "silenced mode on"
      $game_map.autoplay
   
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
  end
end

ArcaneAlchemy

For anyone that didn't want to use a codec or make the user install one, here is a quick reference to quickly converting your midi and ogg files into mp3. All in all it takes about 15 minutes.

For the MIDI Files(BGM and ME) you can go here:  http://mp3.about.com/od/musicformats/ht/How-To-Convert-Midi-To-Mp3-Convert-Midi-Files-To-Mp3s-Using-Free-Software.htm
This will provide a short guide and a link to the program.

For the .ogg files, go ahead and get this: http://www.any-audio-converter.com/

Both of these programs will let you convert in bulk so it makes it go pretty quickly. I know that it will create some extra space but I don't think it'll matter that much. Anyway, I ran the installers through virustotal, but if you're like me you'll go ahead and run them in a VM if you have one set up already. These programs do seem legit though, just make sure and uncheck to install AVG lol.
"Wait? Do I look like a waiter?" -Kefka

gerrtunk

Very interesting alternative. I already convert songs but not in bulk. I suppose that you need to convert al rtp sounds and music and reimport they no? and the songs work perfect with the encoding of that program? i say that because  some mp3 songs dont play very well in rpgmaker xp. Like for example not playing at all or never looping...


ArcaneAlchemy

January 12, 2013, 07:29:50 pm #34 Last Edit: January 13, 2013, 06:04:52 pm by ArcaneAlchemy
Yeah, actually you don't have to manually reimport each and every one. If you simply replace your BGM,BGS,ME, and SE folders inside the Audio folder they will all be imported automatically and will automatically replace all sounds like sword swing, game over, ect. The only problem I have seen so far, and it is a pretty bad one, is some major lag when I use the CCTS and it starts to rain. MP3 may not be the end all alternative for the BGS or perhaps anything. I am currently testing what will run the smoothest.

EDIT:
Sorry for posting 3 times in a row, but I am wondering if there's anyone who can figure out why this script is causing lag when I am using CCTS. I have tried to manually set sound and weather effects and that doesn't seem to disturb anything. Only when a rainstorm starts, there is a super lag both in sound and graphics. It's not the sound file type, because I just got done thoroughly troubleshooting that. Any ideas anyone?

Please do NOT double post within a 24 hour period. There is a modify button for a reason. ~ gameus

Sorry man, I am new here and still learning proper etiquette. Will do in the future.
"Wait? Do I look like a waiter?" -Kefka

G_G

Please don't double post within a 24 hour period. Instead just use the Modify button.

Wecoc

gerrtunk: firstly it didn't work but then I saw you just put a $game_map.autoplay more below the if. Now it works, thank you so much.
-----------
One last thing; with this script you can control what you could not before; duration and position.
So well, I think it could be possible now to fix the RPG maker issue on the looping of mp3 and ogg... When songs loop, the RPG maker always makes some space between the end and the start of the song. Maybe if the song repeats before position equating duration. I tried to modify the update, but I just can't. Could anyone do it? Is it possible to fix that internal bug? It would be amazing.

gerrtunk

i update this looking for help for the latency again!

MarkHest

Just want to state something really quick which is a minior problem but still very annoying.

When using sound for messages with Multiple Message Windows Ex and when using this script it makes a small scrachy jump every time the message sound is played. It's gets annoying fast :roll:
Might wanna state it in the comments of the script or try to fix it?
   

ForeverZer0

This script might need an update, too...

As for the MMS script, does it do it when you are using an SE with every letter?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.