The key to this I think is to get a numeric index of the .wav sound files in some folder. You will do that with the
FileView Plugin.
Once you have a numeric index of the files, you can use a
Calc measure with the
Random function to select and play one of the files from the folder. The
UniqueRandom option will ensure each is only played once until all have been played. The Quote Plugin does not have this capability. Quote is "random" in the sense of rolling a pair of dice. Repeats are possible, and with the fewer the number of files to select from, more and more likely. Random/UniqueRandom is "random" in the sense of drawing a card from a deck and discarding it. Repeats are not possible.
To play a random sound on demand, on a click, you could use something like:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[PlayStop]
[Variables]
[MeasureFolder]
Measure=Plugin
Plugin=FileView
Path=C:\Users\Jeffrey\Sound Files
Extensions=wav
ShowDotDot=0
ShowFolder=0
; The Count option should be large enough, or larger, than the number of files you are likely to ever have in the folder.
Count=200
[MeasureCount]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Type=FileCount
[MeasureRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=[MeasureCount:]
UpdateRandom=1
UniqueRandom=1
DynamicVariables=1
UpdateDivider=-1
[MeasureFile]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Index=[MeasureRandom:]
Type=FilePath
DynamicVariables=1
UpdateDivider=-1
[MeterFile]
Meter=String
MeasureName=MeasureFile
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Hidden=1
[MeterPlay]
Meter=String
Y=30r
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Play a Sound
LeftMouseUpAction=[!UpdateMeasure MeasureRandom][!UpdateMeasure MeasureFile][Play "[MeasureFile]"][!ShowMeter MeterFile][!UpdateMeter *][!Redraw]
Personally, I would never have a skin that plays any sound on some regular, unattended basis. That would quickly drive me right out of my mind. While I'm doing something else, like playing a game or watching a video, having some skin saying "Hey!" like some annoying Navi from Zelda would have me unloading the skin within minutes. Can it be done? Sure, but ... ick.