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

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

Previous topic - Next topic

MarkHest

Yes, but there's no way to change the letter sound speed because of a bug :P
   

ForeverZer0

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.

MarkHest

In the advanced message script :P I made a post about it.
   

Simon Greedwell

Sorry for the necropost but I can't seem to get gerrtunk's fix to work. Can anyone help me here?
Bury with my...money!

ForeverZer0

* UPDATED TO VERSION 1.3 *

Fixed a bug that would cause BGM/BGS to restart from the beginning when the player transfered from one map to another that had the same BGM or BGS. Would have fixed this long ago, but I don't remember hearing about it, just happen to see it mentioned in another thread.

Sorry 'bout that.
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.

MindOnFire

... This is absolutely incredible. Something like this could be used to implement dynamic soundtracks in an RPG Maker game by streaming the stems of a song as separate tracks simultaneously and allowing them to "fade in" by turning up the volume via event command.

Definitely leveled up. Since I'll probably never finish a game of my own, I really hope someone else figures out how to utilize this idea.
Then.
Now.
Forever.

Rairun

This is amazing! Seriously, one of the best scripts I've ever seen.

I have two questions:

1. Is there a way to loop sounds seamlessly? When using the RPG Maker VX Ace sound engine, I can loop .wav files without problems. When I use MCI, I can still loop the file, but not seamlessly. There's always a gap.

2. Can this script be used commercially? I'm very far from finishing my project, but if I'm happy with it, I'd consider releasing it commercially.


ForeverZer0

1. As for actual playback, there isn't really much that can be done, this script merely acts as a wrapper for Window's built-in MCI, so it is not actually doing any sound processing itself. Have you attempted converting from .wav to another format and see if the problem persists?

2. Yes, it can be used royalty-free commercially, only ever ask for a place in the credits. Eric "ForeverZer0" Freed.
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.

Rairun

Thanks for replying so quickly!

I'm pretty sure it happens with MP3 and WAV files (MP3s are tricky to loop anyway, because there's always a bit of silence when they are encoded.) I haven't tried it with OGG files because I want to avoid codec dependencies. I'm not using the MCI Audio Player as a full replacement, so if the user doesn't have a codec, I don't want some sounds to play but not others.

And yes, I'm aware the script is only a wrapper, but I was wondering whether there was a possible workaround. When I use the seek command, I don't hear a gap, so maybe there is a way to trigger it right before the song is over, taking us to the start without ever "officially" starting over? That way we could avoid the troublesome MCI repeat command, looping the audio seamlessly.

stellaH

February 09, 2015, 11:53:58 am #49 Last Edit: February 09, 2015, 11:59:06 am by stellaH
This is what I've been looking for, but I met some problems.

Since I can't express the situation in English properly, hope you don't mind me using pictures in my reply.

If I tried to get the sound this way


I got the following messages


And it told me that here's a problem


ForeverZer0

Ensure the file is there and in the proper directory.
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.

stellaH

February 10, 2015, 10:17:19 am #51 Last Edit: February 10, 2015, 02:39:20 pm by KK20
Thanks for reply!
We've put it in the proper directory and got our audio played now.

Still I failed to reach a effect below.

I wish to play an audio by hitting a key.
It should play the audio as I hit and fade out as I release it.

I tried the following method.

Event 1
Spoiler: ShowHide







The second page is to avoid replay.


Event 2
Spoiler: ShowHide



This event is to  make sure I can release the key anytime.

But the problem is, as I release the key, turning off "Self Switch A" from page 2 to page 1.
My audio cannot be played before the fading out is finished because of the instruction on page 2 still works.

I wonder if that's possible to play the very audio the second times as I hit it again?
Just like a piano does......

I really wish I could express my question more clearly, though I guess it may be another dumb question.
I eager to solve the problem so badly that I have to ask for help again.
Thanks for sharing and answering.


KK20

-spoilers images-

I'm pretty sure you can do this in one event with 2 pages.

1st page (Parallel Process):
Conditional Branch: if Input.trigger?(YOUR_BUTTON)
> Play SE
> Self Switch A = ON
End

2nd Page (Self Switch A is ON, Parallel Process):
Conditional Branch: if Input.release?(YOUR_BUTTON)
> Fade SE
> Self Switch A = OFF
End

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!

stellaH

thanks for spoilering images for me!

Thanks to your advise, I now removed those unnecessary processes.

Only that when returning to page 1, the audio is still effected by the fading instruction on page 2.
Is there a chance that I can solve the problem? Can I end the fading out effect before page 1 starts?

Rairun

A second fade command might override the first (instead of only being run when the first is finished). I can't try it right now, but place this right after the ".play" script call:

Audio['La#2ยด].fade(1,100)


stellaH


Rairun

No worries! Also, I'm pretty sure you can simplify the event even further. On the same page:

Conditional Branch: if Input.trigger?(YOUR_BUTTON)
> Play SE
> Self Switch A = ON
End

Conditional Branch: if Input.release?(YOUR_BUTTON)
> Fade SE
> Self Switch A = OFF
End

I'd also include a wait command in there to reduce lag (start at 15 and go down until you don't notice a delay).