I want a LUA script to play a sound when something happens and have tried
SKIN:Bang('!execute [PLAY NewFeed.wav]')
Problem is that it seems to play a default / error sound. What have I done wrong?
It is currently April 25th, 2024, 2:52 pm
Play .wav file from LUA script
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Play .wav file from LUA script
Have you upgraded to this week's 2.1 Beta? The PLAY bang was broken in the last one, but should now be fixed.
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Play .wav file from LUA script
Just uploaded Rainmeter-2.1-r912-beta but still get the same Bong! Bong! when the LUA script runs.Kaelri wrote:Have you upgraded to this week's 2.1 Beta?.
Is the SKIN:Bang('!execute [PLAY NewFeed.wav]') the command / statement I should be using?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Play .wav file from LUA script
You need the path to the .wav file.
CurrPath = SKIN:GetVariable("CURRENTPATH")
SKIN:Bang('PLAY '..CurrPath..'NewFeed.wav')
NO path is "relative" to the skin in a .lua file, and in any case the PLAY command requires a full filespec.
CurrPath = SKIN:GetVariable("CURRENTPATH")
SKIN:Bang('PLAY '..CurrPath..'NewFeed.wav')
NO path is "relative" to the skin in a .lua file, and in any case the PLAY command requires a full filespec.
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Play .wav file from LUA script
Or simply SKIN:Bang(PLAY NewFeed.wav).Mordasius wrote:Is the SKIN:Bang('!execute [PLAY NewFeed.wav]') the command / statement I should be using?
It's not just you, though. I can't get PLAY to work either; looks like something's still broken on Rainmeter's end.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Play .wav file from LUA script
http://forum.rainmeter.net/viewtopic.php?p=55478#p55478Kaelri wrote: Or simply SKIN:Bang(PLAY NewFeed.wav).
It's not just you, though. I can't get PLAY to work either; looks like something's still broken on Rainmeter's end.
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Play .wav file from LUA script
Thank you Kaelri and JS Morley - It will take me a day or two to catch up with your advice and suggestions, but I'm sure I'll get there in the end.
Many, Many Thanks to both of you..
Many, Many Thanks to both of you..
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Play .wav file from LUA script
Whoops, sorry. Somehow I managed to completely miss your message.jsmorley wrote: http://forum.rainmeter.net/viewtopic.php?p=55478#p55478
-
- Posts: 1173
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Play .wav file from LUA script
This just seems to bring me back to this post. What have I done wrong?jsmorley wrote:http://forum.rainmeter.net/viewtopic.php?p=55478#p55478
-
- Developer
- Posts: 1721
- Joined: July 25th, 2009, 4:47 am
Re: Play .wav file from LUA script
He was linking me to the post he made right before mine, which I missed by being an idiot.