It is currently September 29th, 2024, 7:28 am

"Play" action question

General topics related to Rainmeter.
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

"Play" action question

Post by rbriddickk84 »

Hey there!

I made a simple button, and on mouse over i make it play a short wav. Now, when i leave faster the detecting area with my mouse then my sounds file would ending normally, then it stops earlier. So for example if i have an 1s long wav file, and i leave the area at 0,5s then the sound file will cut and stop at 0,5s. Can it be somehow control the playing behaviour of that, so when i leave the area, it only stops when the sound file reaches the end of it? And starts that sound file each time when i hover my mouse over?

Thank you
User avatar
jsmorley
Developer
Posts: 22783
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: "Play" action question

Post by jsmorley »

The way the Play command works, and there are no work-around methods to get different behavior, is:

When you say [Play "SomeWavFile.wav"] that sound will be played by Windows. It will be played in full.

When you say [PlayStop] any sound being played by any skin will immediately be stopped by Windows.

If you say [Play "SomeWavFile.wav"] any sound already being played by any skin will immediately be stopped by Windows, and the new sound will be played.

So if you have MouseOverAction=[Play "SomeWavFile.wav"], then the sound will be played when you mouse over the meter. It will not stop playing until finished unless you for instance have MouseLeaveAction=[PlayStop] on the same meter, or MouseOverAction=[PlayStop] on some other meter that you move the mouse over.

The long and the short of it is that there is ONE sound that Rainmeter can play at a time, and this is at the overall Rainmeter level, not the skin level. One, just one. The sound will be played in full unless you stop it.

What you are saying is simply not accurate, or at least incomplete. A sound called by a mouse over will simply not stop playing just because you move the mouse off of the meter.

Be careful that you don't have a button that has transparent areas in the button image, and as you move your mouse around on the image it is is causing it to "start, stop and start over, stop and start over" etc...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5534
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: "Play" action question

Post by eclectic-tech »

Can you post your code?

The PLAY command will play any sound.wav all the way to end unless there is another sound.wav called, or you send PLAYSTOP.
PLAY Commands

"I must type faster. I must type faster. I must type faster. I must type faster." JSMorley beat me to the post!
User avatar
rbriddickk84
Rainmeter Sage
Posts: 276
Joined: February 17th, 2014, 12:39 pm
Location: Hungary

Re: "Play" action question

Post by rbriddickk84 »

Ahh, i see now! :)
Well my code is simple (at least the "Play" part of it), both of you answered my phenomenon. Yes, that is right, it isn't ended when i leaved from that area, it stops when i entering there again. I done it so fast and the sound file is so short that i didn't noticed the exact time.
Well then, i probably should forget about playing sound when i hover my mouse over my buttons.

Thank you very much for the helping answeres! :D

But here is the simple code from my button
Meter=Image
SolidColor=0,0,0,1
X=0
Y=0
W=200
H=50
MouseOverAction=[Play "hover.wav"]