It is currently April 18th, 2024, 5:37 pm

Show Spatial Audio as Off, Sonic, or Atmos, etc.

General topics related to Rainmeter.
Nominus
Posts: 1
Joined: October 9th, 2020, 11:11 am

Show Spatial Audio as Off, Sonic, or Atmos, etc.

Post by Nominus »

It's my first day with Rainmeter. I found a Volume widget that I'd like to modify to also show the current Spatial Audio state. Ideally, I would have it under the actual volume meter. Is this possible? If so, how?

Thanks!
Nom

Code: Select all

[Rainmeter]
BackgroundMode=2
SolidColor=0,0,0,150
Update=1000

; Returns the name of the current sound device and percent volume level
[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin

; Display the current sound device name
[MeterDeviceName]
Meter=String
MeasureName=MeasureWin7Audio
X=5
Y=0
W=200
H=20
FontFace=Trebuchet MS
FontSize=11
FontColor=255,255,255,255
StringAlign=LEFT
AntiAlias=1
ClipString=1

; Toggle to the next installed sound device (wraps back to first)
[MeterChangeDevice]
Meter=String
FontFace=Trebuchet MS
FontSize=15
FontColor=255,255,255,255
AntiAlias=1
X=220
Y=-3
Text="+"
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "ToggleNext"

; Change the volume down by 10%
[MeterVolumeDown]
Meter=String
FontFace=Trebuchet MS
FontSize=15
FontColor=255,255,255,255
AntiAlias=1
X=0
Y=20
Text="<<"
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "ChangeVolume -10"

[MeasureVolBarBackground]
Measure=Calc
Formula=1
[MeterVolBarBackground]
Meter=Bar
MeasureName=MeasureVolBarBackground
BarOrientation=Horizontal
BarColor=150,150,150,255
W=60
H=6
X=25
Y=29

; Displays the current volume percentage on a Bar meter
[MeterCurrentVolumeBar]
Meter=Bar
MeasureName=MeasureWin7Audio
BarOrientation=Horizontal
W=60
H=6
X=25
Y=29

; Change the volume up by 10%
[MeterVolumeUp]
Meter=String
FontFace=Trebuchet MS
FontSize=15
FontColor=255,255,255,255
AntiAlias=1
X=83
Y=20
Text=">>"
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "ChangeVolume 10"

; Displays the percentage volume level as text
[MeterVolPercent]
Meter=String
X=55
Y=40
W=110
H=15
FontFace=Trebuchet MS
FontSize=10
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1
Text=[MeasureWin7Audio:]%
DynamicVariables=1

; Toggles "mute" for the current device
[MeterVolToggleMute]
Meter=String
X=5
Y=60
FontFace=Trebuchet MS
FontSize=10
FontColor=255,255,255,255
StringAlign=Left
AntiAlias=1
Text=MUTE
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "ToggleMute"

; Set volume for current device to 50%
[MeterVolSet50%]
Meter=String
X=78
Y=60
FontFace=Trebuchet MS
FontSize=10
FontColor=255,255,255,255
StringAlign=Left
AntiAlias=1
Text=50%
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 50"
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Show Spatial Audio as Off, Sonic, or Atmos, etc.

Post by balala »

Nominus wrote: October 9th, 2020, 11:32 am I found a Volume widget
In Rainmeter they are called skins, not widgets.
Nominus wrote: October 9th, 2020, 11:32 am I'd like to modify to also show the current Spatial Audio state.
What the "Spatial Audio state" is? Because me persoanlly at least don't know.
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Show Spatial Audio as Off, Sonic, or Atmos, etc.

Post by brax64 »

balala wrote: October 9th, 2020, 12:16 pm What the "Spatial Audio state" is? Because me persoanlly at least don't know.
Hi balala,

I'm guessing the OP is referring to as "Spatial Audio state", to a Window setting relate to the volume control; in detail if you right-click on the volume icon in the window task bar, it opens up a menu where you can see an option called "Spatial Sound" that can be on or off; not sure if it will be the same in every system, in mine it shows, as possible states, "Off" or "Windows Sonic for Headphones".
If this is the case, I don't have a clue though how to retrieve that state with Rainmeter...
Only the OP can confirm or deny if my guessing is correct, if not please disregard..
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Show Spatial Audio as Off, Sonic, or Atmos, etc.

Post by balala »

brax64 wrote: October 9th, 2020, 8:30 pm I'm guessing the OP is referring to as "Spatial Audio state", to a Window setting relate to the volume control; in detail if you right-click on the volume icon in the window task bar, it opens up a menu where you can see an option called "Spatial Sound" that can be on or off; not sure if it will be the same in every system, in mine it shows, as possible states, "Off" or "Windows Sonic for Headphones".
If this is the case, I don't have a clue though how to retrieve that state with Rainmeter...
Only the OP can confirm or deny if my guessing is correct, if not please disregard..
Yes, probably it si correct. I didn't figure this out, but unfortunately I also have no clue so far on how to approach this.
User avatar
Yincognito
Rainmeter Sage
Posts: 7123
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Show Spatial Audio as Off, Sonic, or Atmos, etc.

Post by Yincognito »

Nominus wrote: October 9th, 2020, 11:32 am It's my first day with Rainmeter. I found a Volume widget that I'd like to modify to also show the current Spatial Audio state. Ideally, I would have it under the actual volume meter. Is this possible? If so, how?
LOL, it's your first day with Rainmeter and you chose such an ambitious task like showing the Spatial Audio state, something that's not even that well documented in Windows, at least for regular users - well done. :thumbup:

There aren't many avenues you can try with this, as Rainmeter or its plugins (Win7Audio or AudioLevel) don't offer that kind of info, they're more like "general purpose" stuff and not very specific to one particular area. What you can try is:

- investigate the registry for some key that holds the desired state (simple Find in the registry and maybe you'll get lucky), as Rainmeter has measures that can get some of those registry values
- try some NirSoft utilities, maybe you can achieve something close (as far as I can tell, they can set the Spatial Audio, but not sure if they can get its status) and then run them through the RunCommand plugin
- look for other similar utilities that ideally can be used from the command line in Windows, as Rainmeter's RunCommand plugin can run pretty much everything there
- see if you can get help on this from Microsoft, maybe they can provide you with a helpful registry key or some other hidden Windows executable that you can run and get what you want

Good luck trying this - you can share your findings here of course, if you are successful. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth