It is currently April 19th, 2024, 2:31 pm
Please help, music in rainmeter
-
- Posts: 1
- Joined: September 19th, 2019, 1:32 am
Please help, music in rainmeter
Hello there, thanks for clicking on this post, it would mean a lot to me if someone helped me out on this problem: I want a certain song to start playing when I power on my PC. Is there anyway of doing this, If so how? Perferably through a downloaded song or YouTube Music or something like that. Would mean the world if someone helped me. Thanks
-
- Rainmeter Sage
- Posts: 5393
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Please help, music in rainmeter
It is possible to perform an action 1 time when a skin is loaded by using this code. The key is the "Counter" variable which starts to count from zero when the skin is loaded, and is only reset when the skin re-loads (not on updates or refresh). The "IfAboveAction=" bang will fire 1 time to do anything you want.
This will open a youtube page, but you need to click the page to play.
This will play the Windows 10 Logon sound.
Evey skin must have at least 1 meter to be valid, so a "Dummy" string meter was added to each example.
(RunOnce suggested by JSMorley, of course! )
This will open a youtube page, but you need to click the page to play.
Code: Select all
[RunOnceYouTube]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=["https://www.youtube.com/watch?v=fRL447oDId4"]
IfAboveValue=1
IfAboveAction=[!DisableMeasure RunOnceYouTube]
[MeterDummy]
Meter=String
Code: Select all
[RunOnceWav]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[Play "chord.wav"]
IfAboveValue=1
IfAboveAction=[!DisableMeasure RunOnceWav]
[MeterDummy]
Meter=String
(RunOnce suggested by JSMorley, of course! )
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Please help, music in rainmeter
Here is one that will play any .mp3 file without opening any bulky player or a separate window.
It requires a small external executable, which is included in the .rmskin.
https://lawlessguy.wordpress.com/2015/06/27/update-to-a-command-line-mp3-player-for-windows/
It requires a small external executable, which is included in the .rmskin.
https://lawlessguy.wordpress.com/2015/06/27/update-to-a-command-line-mp3-player-for-windows/
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Metadata]
Name=PlayMP3
Author=JSMorley
Information=Uses the external cmdmp3win.exe to play any .mp3 file.
Version=Sep 20, 2019
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
[Variables]
Song=#@#Songs\Vienna Teng - Lullabye for a Stormy Night.mp3
Player=#@#cmdmp3\cmdmp3win.exe
[MeasureKill]
Measure=Plugin
Plugin=RunCommand
Parameter=taskkill /IM "cmdmp3win.exe" /F
State=Hide
[RunOnceMP3]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!CommandMeasure MeasureKill "Run"][!Delay 500]["#Player#" "#Song#"]
IfAboveValue=1
IfAboveAction=[!DisableMeasure RunOnceMP3]
[MeterPlay]
Meter=Image
W=25
H=25
SolidColor=101,244,0,255
LeftMouseUpAction=[!CommandMeasure MeasureKill "Run"][!Delay 500]["#Player#" "#Song#"]
[MeterStop]
Meter=Image
X=5R
W=25
H=25
SolidColor=255,45,7,255
LeftMouseUpAction=[!CommandMeasure MeasureKill "Run"]
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Please help, music in rainmeter
Note that cmdmp3win.exe does not run in an "exclusive" mode, so you can easily get a cacophonous "row, row, row your boat" round going if you play the song repeatedly. You can avoid this by having the command to play the song be:
[taskkill /IM "cmdmp3win.exe" /F]["#Player#" "#Song#"]
So it stops any currently playing songs before it starts a new one.
Also note that the taskkill.exe command is a built-in external cmd/dos command that will very briefly open a cmd window when executed. This can be avoided by using the RunCommand plugin to execute it, if you like.
https://docs.rainmeter.net/manual/plugins/runcommand/
[taskkill /IM "cmdmp3win.exe" /F]["#Player#" "#Song#"]
So it stops any currently playing songs before it starts a new one.
Also note that the taskkill.exe command is a built-in external cmd/dos command that will very briefly open a cmd window when executed. This can be avoided by using the RunCommand plugin to execute it, if you like.
https://docs.rainmeter.net/manual/plugins/runcommand/
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Please help, music in rainmeter
So maybe a more robust version might be:
Updated the .rmskin above to reflect this...
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Metadata]
Name=PlayMP3
Author=JSMorley
Information=Uses the external cmdmp3win.exe to play any .mp3 file.
Version=Sep 20, 2019
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
[Variables]
Song=#@#Songs\Vienna Teng - Lullabye for a Stormy Night.mp3
Player=#@#cmdmp3\cmdmp3win.exe
[MeasureKill]
Measure=Plugin
Plugin=RunCommand
Parameter=taskkill /IM "cmdmp3win.exe" /F
State=Hide
[RunOnceMP3]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!CommandMeasure MeasureKill "Run"][!Delay 500]["#Player#" "#Song#"]
IfAboveValue=1
IfAboveAction=[!DisableMeasure RunOnceMP3]
[MeterPlay]
Meter=Image
W=25
H=25
SolidColor=101,244,0,255
LeftMouseUpAction=[!CommandMeasure MeasureKill "Run"][!Delay 500]["#Player#" "#Song#"]
[MeterStop]
Meter=Image
X=5R
W=25
H=25
SolidColor=255,45,7,255
LeftMouseUpAction=[!CommandMeasure MeasureKill "Run"]