Rank: Advanced Member
Groups: Translators, Approved Joined: 7/17/2021(UTC) Posts: 135
Thanks: 35 times Was thanked: 18 time(s) in 15 post(s)
|
Hi all,I was wondering if there is a way to directly change the audio levels of left and right sides of headphones(audio device) separately using S+ For example: have left side audio level 20 and right side audio level 22; it is helpful for people who have slight hearing issue on one ear. I currently use this command to open Sound properties: Code:sp.RunProgram('rundll32.exe', String.raw` Shell32.dll,Control_RunDLL Mmsys.cpl,,0`, 'open', 'normal', false, false, false);
After that I have to open a sound device's properties, then go to the Levels tab, and then change levels from Balance menu. There are some software like SimpleSndVol but it would be much better to do using S+ gestures. Also the levels get reset once volume is brought to zero so S+ is handy in changing them frequently. Thanks
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,360 Location: Tampa, FL Thanks: 28 times Was thanked: 421 time(s) in 357 post(s)
|
Managing sound in Windows is overly complicated, so there's not much built-in but what comes with CoreAudioDevice, which is a third-party library that is included with S+. It's probably easiest to just shell out to a command line utility designed to handle it, for example: https://www.nirsoft.net/articles/set-audio-balance-command-line.htmlEdited by user Tuesday, February 22, 2022 5:40:51 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Translators, Approved Joined: 7/17/2021(UTC) Posts: 135
Thanks: 35 times Was thanked: 18 time(s) in 15 post(s)
|
Thanks for the quick feedback RobI came across this software but I thought it would need to be closed manually every time it ran. Now, I tried it and it seems that the program starts, does the job, and then quickly closes on its own when using command line (as observed using process explorer) So everything is good now I guess.. but still I have a noob question, how do you kill/close a program using S+?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,360 Location: Tampa, FL Thanks: 28 times Was thanked: 421 time(s) in 357 post(s)
|
Assuming S+ is allowed to access the process, here are a few examples. Code:// Graceful way by process ID
var proc = System.Diagnostics.Process.GetProcessById(9836);
proc.CloseMainWindow();
proc.Close();
// Force kill by process ID
var proc = System.Diagnostics.Process.GetProcessById(9836);
proc.Kill();
// Graceful way by partial window title
var wnd = sp.WindowsFromTitlePartial("Untitled - Paint").First();
wnd.Process.CloseMainWindow();
wnd.Process.Close();
// Force kill by partial window title
var wnd = sp.WindowsFromTitlePartial("Untitled - Paint").First();
wnd.Process.Kill();
|
1 user thanked Rob for this useful post.
|
|
|
Rank: Advanced Member
Groups: Translators, Approved Joined: 7/17/2021(UTC) Posts: 135
Thanks: 35 times Was thanked: 18 time(s) in 15 post(s)
|
Amazing!! Thanks a lot Rob
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Approved Joined: 4/23/2020(UTC) Posts: 161 Thanks: 46 times Was thanked: 23 time(s) in 17 post(s)
|
Does it seems different to wnd.SendClose?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,360 Location: Tampa, FL Thanks: 28 times Was thanked: 421 time(s) in 357 post(s)
|
SendClose() is usually sufficient and about the same.
Kill() is when you just want to force close an app, especially a command line app that doesn't have a window.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close