Open Suncatcher opened 6 years ago
@Suncatcher No, not at this point.
@Suncatcher I have started the fork dev_v3.1_communicationDevice for this enhancement request. Until then, it IS possible with the current version to get the processID/processName, volume level, and mute state of the different applications under each audio device. This is just a workaround, but please see the following file https://github.com/frgnca/AudioDeviceCmdlets/blob/dev_volume-mixer/dev_volume-mixer.ps1
Spectacular, man! Will check it soon.
Well, I tried it and found out it's not working as it intended. Here is the output of dev_volume-mixer.ps1
App
Idle
Volume
100
Mute
False
########################
It shows Idle
whilst in fact I have two apps active in mixer: System sounds and Chrome, and none of them has volume level 100.
@Suncatcher How about with the file as it is now? Is the result the same with $deviceIndex=1
I think it was giving you the informations about the second AudioDevice which might have been the default recording device.
@Suncatcher In fact, could you try the dll from the dev branch and tell me what you think?
Get-AudioSession -List
Here's what it looks like at this point
Well, it works not without glitches, but works and that's wonderful. About glitches:
It shows wrong level, e.g. 38% on the screenshot, when in reality it's 21%. Also It shows Idle
instead of system sounds.
But all that doesn't matter for me. Could you please build a single cmdlet for this function? E.g. GetMixerVolumes
or smth like that?
It's very cumbersome to type this script every time
$deviceIndex=1
########################
# Set $i to zero
$i=0
# While $i is less than the amount of audio session on the audio device
while($i -lt (Get-AudioDevice -Index $deviceIndex).Device.AudioSessionManager.Sessions.Count)
{
Write-Host "########################"
# Display audio session number
Write-Host "Audio session #$($i + 1)"
# Display processID of audio session
Write-Host "Process name: $((Get-Process -Id (Get-AudioDevice -Index $deviceIndex).Device.AudioSessionManager.Sessions[$i].ProcessID).ProcessName)"
# Display volume level of audio session
Write-Host "Volume level: $(((Get-AudioDevice -Index $deviceIndex).Device.AudioSessionManager.Sessions[$i].SimpleAudioVolume.MasterVolume * 100).ToString('#'))%"
# Display mute state of audio session
Write-Host "Mute state: $((Get-AudioDevice -Index $deviceIndex).Device.AudioSessionManager.Sessions[$i].SimpleAudioVolume.Mute)"
# Increment $i
$i++
}
Write-Host "########################"
Also, is it possible to install your module not manually but via NuGet or some automated manner? In order to be up to date when your DLL is updated.
@Suncatcher We're working on getting the new version published to the PowerShell Gallery.
Old version: https://www.powershellgallery.com/packages/AudioDeviceCmdlets/
@Suncatcher
It shows wrong level, e.g. 38% on the screenshot, when in reality it's 21%. Also It shows Idle instead of system sounds.
You're right. Those things have now been corrected in the dev dll. I found out later it's because the volume level of an audio channel that the CoreAudioApi gives is in relation to the current volume level of the audio device, unlike on the GUI where it is in relation to the maximum volume level.
As for being able to install the module not manually, I will get back to you once it is updated on the PowerShell Gallery.
Thanks a ton!
I can confirme the current v3.0 dll is now available from the PowerShell Gallery. When I merge in the finished volume mixer feature, I will update to v3.1 there.
PS> Save-Module -Name AudioDeviceCmdlets -Path <path>
PS> Install-Module -Name AudioDeviceCmdlets
I installed you module from PS Gallery exactly like above, but module commands are not recognized and in the exported commands I see nothing
Does it mean it was installed incorrectly?
It probably means that I don't know how to properly publish to PS Gallery. I will definitely look into that when I have the time. Thank you for bringing this to my attention.
Well, I assume this is not the problem of publishing, but the problem of incorrect installation. As I said, module commands are not recognized:
PS C:\Users\User> Get-AudioDevice -List
Get-AudioDevice : The term 'Get-AudioDevice' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ Get-AudioDevice -List
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-AudioDevice:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
What has gone wrong? I just done
PS> Save-Module -Name AudioDeviceCmdlets -Path <path>
PS> Install-Module -Name AudioDeviceCmdlets
Mmm, any suggestions? Tried to reinstall multiple times but module cmdlets are still not recognized.
This link ain't working anymore: https://github.com/frgnca/AudioDeviceCmdlets/blob/dev_volume-mixer/AudioDeviceCmdlets.dll I was looking for a way to log at regular intervals the audio volume settings of devices and applications. Reason being: Users complain about seemingly randomly changing audio settings. So I was planning on some sort of script which would generate an output trigger either by time or some sort of application event. But, yeah, it seems like this dev tree has been deleted, am I correct?
Correct. I still plan on adding this feature and merge it with future version v3.1 but I am currently in the process of moving places so I might not be able to code for this project for a bit.
Do you still have that mentioned .dll for me to play around with until that time? :)
On Fri, Sep 21, 2018 at 3:31 PM frgnca notifications@github.com wrote:
Correct. I still plan on adding this feature and merge it with future version v3.1 but I am currently in the process of moving places so I might not be able to code for this project for a bit.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/frgnca/AudioDeviceCmdlets/issues/18#issuecomment-423531698, or mute the thread https://github.com/notifications/unsubscribe-auth/ApdNXHkIcCHZtZSDukgek4d4NtG57rVHks5udOoqgaJpZM4TMKJV .
Any update here?
Bump, any update? This feature would be awesome
Windows 10 (and presumably 11) has the ability to set what audio devices that individual apps listen to. For some reason, however, it resets often for me. If AudioDeviceCmdlets had the ability to set this, I could set up a script to run with Task Scheduler to make sure my apps are set correctly.
I know this is over a year old, but I am very interested in having this added.
Any update on this?
Does your cmdlet support getting info about apps that are currently active (=playing) in Windows Volume Mixer like this? I wanna list them and get info about their volume levels.