It is currently March 28th, 2024, 11:52 pm

Play a sound when Rainmeter starts

Get help with installing and using Rainmeter.
User avatar
AlphaUMi
Posts: 5
Joined: June 13th, 2018, 4:17 pm
Location: 127.0.0.1

Play a sound when Rainmeter starts

Post by AlphaUMi »

Hi everyone!

This is mi first post, I am a long time Rainmeter user, not a skin creator, but confident with Rainmeter and skins configuration files. My question is the following: is it possible to make Rainmeter play a sound automatically as soon as a layout is loaded?

I know about the Play bang (not !Play, I know), but I couldn't get it to work for me. What I want to achieve is:

1. Rainmeter is closed, or PC is off.
2. Rainmeter starts, loads the layout, and play a sound.

I mean: it plays a sound automatically like a sort of "intro", without mouse clicks or user interaction. I would like to achieve this:

1. Or with a shortcut, with a command line parameter
2. Or attaching the Play bang to a section of a skin that is loaded when Rainmeter starts.

I hope someone can help me.
Cheers,

AlphaUMi
"Vitam impendere vero"
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Play a sound when Rainmeter starts

Post by jsmorley »

Code: Select all

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfCondition=MeasureOnLoad = 1
IfTrueAction=[Play "#@#\Sounds\Wecome2.wav"]
UpdateDivider=-1
This will play the sound when the skin you put this in (it can be any skin you always load) is first loaded, which will be when Rainmeter is started...
Welcome2.WAV
You do not have the required permissions to view the files attached to this post.
User avatar
AlphaUMi
Posts: 5
Joined: June 13th, 2018, 4:17 pm
Location: 127.0.0.1

Re: Play a sound when Rainmeter starts

Post by AlphaUMi »

Oh yes, thank you! Really, sincerely, thank you a lot!!! :17good

And in the process I've learned the MeasureOnLoad... it's great, very useful. Thank you again!!! :great:
"Vitam impendere vero"
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Play a sound when Rainmeter starts

Post by jsmorley »

Glad to help.
remoberserker
Posts: 3
Joined: October 12th, 2022, 11:41 am

Re: Play a sound when Rainmeter starts

Post by remoberserker »

Hi friend could you help me please? I have a problem in Raimeter with Measure as in Post but I would like a Measure script command for a sound when closing a Rainmeter skin. If you can help me thank you. I can't wait then. Have a good day.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Play a sound when Rainmeter starts

Post by eclectic-tech »

remoberserker wrote: October 12th, 2022, 12:05 pm Hi friend could you help me please? I have a problem in Raimeter with Measure as in Post but I would like a Measure script command for a sound when closing a Rainmeter skin. If you can help me thank you. I can't wait then. Have a good day.
Use OnCloseAction in the [Rainmeter] section of the skin to play your sound.
This assumes your sound wav file is located in {YourSkinFolder}\@Resources\Sounds.

Code: Select all

[Rainmeter]
OnCloseAction=[Play "#@#\Sounds\GoodBye.wav"]
remoberserker
Posts: 3
Joined: October 12th, 2022, 11:41 am

Re: Play a sound when Rainmeter starts

Post by remoberserker »

Thanks for responding so quickly buddy but it didn't work universally. I'm using SkinPacks.com Mortal Kombat Premium Theme with RocketDock and Rainmeter with Haunted Skin I think?!? the command in the skin script with the folders above for the .wav sound and when deactivating the skin it did not play the sound. I'm a beginner in this so if you can please help me with the entire shutdown script like the one in the post above forgive the skin because I don't know how to use OnCloseAction and I can't get the option in my skin's script. Please help me friend and sorry to bother you again. Thanks again.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Play a sound when Rainmeter starts

Post by balala »

remoberserker wrote: October 12th, 2022, 11:40 pm Thanks for responding so quickly buddy but it didn't work universally. I'm using SkinPacks.com Mortal Kombat Premium Theme with RocketDock and Rainmeter with Haunted Skin I think?!? the command in the skin script with the folders above for the .wav sound and when deactivating the skin it did not play the sound. I'm a beginner in this so if you can please help me with the entire shutdown script like the one in the post above forgive the skin because I don't know how to use OnCloseAction and I can't get the option in my skin's script. Please help me friend and sorry to bother you again.
You don't bother anyone, we're helping here only willingly, so don't worry.
To do what eclectic-tech described, when the skin you want to add the sound playing on close is on the screen, right click it. In the opening menu click Edit skin. The code of the skin opens in the default text editor. Locate the [Rainmeter] section. It usually is at the beginning of the code, but not necessarily. If you found it see if it has an OnCloseAction option. Most probably it has not, because from my experience I can say there are few skins using such an option, however it might be there. If there is no OnCloseAction, add the option posted by eclectic-tech under the [Rainmeter] section. If there is an OnCloseAction, add his bang ([Play "#@#\Sounds\GoodBye.wav"]) anywhere in the option, next to the existing ones. In the end save the file and refresh the skin (right click it and click Refresh skin). When you did this, you should get the sound playing when you're closing the skin.
Take care to modify the path and the name of the sound file under the Play bang, to the proper one. The #@# variable is representing the @Resources folder of your config. It's recommended and a good practice to place all resources files (for instance images and sound, but not just) to this @Resources folder. To use eclectic-tech's example, you have to have a GoodBye.wav file in the @Resorurces\Sound folder. You have to either create this folder, place the wav file into it and rename the file to GoodBye.wav, or another possibility is to replace the path to the proper file, with the proper path.
If you can't get all above working, please post the code of your skin here.
remoberserker
Posts: 3
Joined: October 12th, 2022, 11:41 am

Re: Play a sound when Rainmeter starts

Post by remoberserker »

Thank you friend. I got it thanks to God and to you. I wish you good luck and all the best. Thank you all.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Play a sound when Rainmeter starts

Post by balala »

remoberserker wrote: October 14th, 2022, 4:42 pm I got it thanks to God and to you.
Did you got it working now? If you did, I'm glad.