xenolightning / AudioSwitcher_v1

Version 1 of Audio Switcher
Microsoft Public License
885 stars 88 forks source link

Remembering favourite device after disconnect #2186

Open Z-ion opened 5 years ago

Z-ion commented 5 years ago

Hello!

The version of AudioSwitcher is 1.8.0.142 (says it is the latest), running it on Windows 10 x64 version 1809.

Like it very much, solves the problem when I need to switch between speakers and USB headphones, that are plugged at the same time. They are used in almost all of the time. But sometime I switch on my external USB soundcard (Steinberg UR242) and want to use it as the default device. The problem is that even if I add it to the list of favourites and see it in context menu in the tray, after I disconnect the card and connect it back - this device is not in the context menu anymore. Also when I open the AudioSwitcher window my external card is no longer marked with a star - need to add it again, so it is listed in the context menu. Fortunately, the system makes it as default. But there is less confort switching between devices the problem I described.

Kverulanthonsen commented 5 years ago

I can confirm this behavior. I have headphones plugged in to a docking station connected to my laptop. Whenever I unplug my laptop and then plug it back in, I have to mark the headphones as favorite device again.

robhaswell commented 4 years ago

+1 here, my FiiO device isn't always recognized immediately at startup. Would be great if AS could remember it as a preference when it appears.

ScHAmPi commented 3 years ago

+1 on this. I'd also love it if AudioSwitcher were to remember the favorite even after disconnecting and reconnecting. Apart from that love the program btw and just donated :).

Kverulanthonsen commented 3 years ago

I don't know if this will be of help to anyone, but I found a workaround that so far works for me:

The settings are stored as a json string in the file C:\Users\\AppData\Local\AudioSwitcher\AudioSwitcher.json

In it, each audio device is represented by a GUID. For instance, I have three favorite devices (one at home, one at work, and one headset which I carry back and forth). This is represented like this:

"FavouriteDevices" : "[4546cf8b-e30e-41b7-aa5c-44467a6e092b],[fd7ea7f9-813f-4644-8444-a63d2926b5f1],[b8fb22e3-656e-4ab7-ad28-f1011ef5b8f5]",

If you search the register for the GUID you can find the "friendly name" of the connected device and figure out which GUID is what. Once you have all the devices you need in the FavouriteDevices list, just set the json-file as read-only and the configuration will stay this way permanently.

Of course, any changes you make to the settings in the program will not be saved as long as the config file is read-only, but if you're like me you just want to set things up once and then leave them.