V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
Bitex
V2EX  ›  分享创造

Audio Device Switcher,用于快速切换默认音频设备的小工具

  •  
  •   Bitex · 2015-03-10 21:54:35 +08:00 · 5000 次点击
    这是一个创建于 3306 天前的主题,其中的信息可能已经有所发展或是发生改变。

    为了方便在耳机和音箱之间切换写了这样一个小工具。如果打开音频设备面板的话,需要右击音量图标 -> 点击播放设备 -> 右击一个音频设备 -> 点击设置为默认设备,麻烦得不行。写了这个小工具就只需要两次点击就好了。

    UI试着仿了一下Win8/8.1几个系统的托盘图标面板(音量、操作中心、OneDrive),没有照顾到其他版本系统的界面,而且实现方式比较笨不敢保证在高分屏上面不会崩掉。

    已知bug是中文的设备名会显示成问号,之后会试着修复。然后想在列表里加上代表硬件的图标,更直观一些,还有i18n。

    截图

    Screenshot

    致谢

    The icon of this application was adapted from icons4android.com's Sound and Audio icon pack under Creative Commons (Attribution 3.0 Unported).

    This application uses AudioEndPointController under MIT License.

    And great thanks to SpikeX for his great article.

    开放源代码许可协议

    遵循GNU General Public License v2.0协议,请参阅LICENSE.

    GitHub repo

    https://github.com/7bitex/Audio-Device-Switcher

    下载

    https://github.com/7bitex/Audio-Device-Switcher/blob/master/Release/Audio%20Device%20Switcher.exe?raw=true

    第 1 条附言  ·  2015-03-11 08:27:37 +08:00
    第 2 条附言  ·  2015-03-11 11:20:48 +08:00
    更新了1.1版本:
    + 添加了本地化支持
    * 界面的细微调整

    下载:
    https://github.com/7bitex/Audio-Device-Switcher/releases/tag/1.1

    (小声)欢迎star我的repo
    第 3 条附言  ·  2015-03-11 16:43:45 +08:00
    修复了中文设备名无法显示的bug,请重新下载:

    https://github.com/7bitex/Audio-Device-Switcher/releases/tag/1.1
    第 4 条附言  ·  2015-03-11 19:18:41 +08:00
    更新1.1.3,修复了对x86以及x64不同平台的兼容性,修复了“缺少MSVCP120D.dll”的问题。

    下载:https://github.com/7bitex/Audio-Device-Switcher/releases

    之后的更新不再这里贴了,如果这个工具对你有用的话,不妨watch或者star一下。
    19 条回复    2018-10-11 15:42:25 +08:00
    freefcw
        1
    freefcw  
       2015-03-10 23:26:12 +08:00   ❤️ 1
    虽然用不着,但看着不错。
    a4840636
        2
    a4840636  
       2015-03-11 00:39:25 +08:00
    不知道有没有办法快速切换声道设定
    或者就用这个工具,接一条多声道的HDMI,再接一条光纤,然后快速切换好了
    abelyao
        3
    abelyao  
       2015-03-11 01:20:55 +08:00   ❤️ 1
    难得在 v2ex 上看到 C# 项目,支持一下
    loveminds
        4
    loveminds  
       2015-03-11 05:22:03 +08:00
    有关调用实时(JIT)调试而不是此对话框的详细信息,
    请参见此消息的结尾。

    ************** 异常文本 **************
    System.ComponentModel.Win32Exception (0x80004005): 系统找不到指定的文件。
    在 System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
    在 System.Diagnostics.Process.Start()
    在 Audio_Device_Switcher.frmPanel.GetAudioDevices()
    在 Audio_Device_Switcher.frmPanel.RefreshAudioDeviceList()
    在 Audio_Device_Switcher.frmPanel.frmPanel_Shown(Object sender, EventArgs e)
    在 System.Windows.Forms.Form.OnShown(EventArgs e)
    在 System.Windows.Forms.Form.CallShownEvent()
    在 System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
    在 System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
    在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    在 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
    在 System.Windows.Forms.Control.InvokeMarshaledCallbacks()


    ************** 已加载的程序集 **************
    mscorlib
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.34003 built by: FX45W81RTMGDR
    基本代码:file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Audio Device Switcher
    程序集版本:1.0.0.0
    Win32 版本:1.0.0.0
    基本代码:file:///C:/Windows/system32/AudioSwitcher.exe
    ----------------------------------------
    System.Windows.Forms
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.33440 built by: FX45W81RTMREL
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.33440 built by: FX45W81RTMREL
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.34003 built by: FX45W81RTMGDR
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Configuration
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.33440 built by: FX45W81RTMREL
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.33440 built by: FX45W81RTMREL
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Windows.Forms.resources
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.33440 built by: FX45W81RTMREL
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll
    ----------------------------------------
    mscorlib.resources
    程序集版本:4.0.0.0
    Win32 版本:4.0.30319.33440 built by: FX45W81RTMREL
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll
    ----------------------------------------

    ************** JIT 调试 **************
    要启用实时(JIT)调试,
    该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
    jitDebugging 值。
    编译应用程序时还必须启用
    调试。

    例如:

    <configuration>
    <system.windows.forms jitDebugging="true" />
    </configuration>

    启用 JIT 调试后,任何未经处理的异常
    都将被发送到在此计算机上注册的 JIT 调试器,
    而不是由此对话框处理。
    loveminds
        5
    loveminds  
       2015-03-11 05:31:42 +08:00
    你引用了个EndPointController.exe,而Thinkpad驱动没有这个文件,故出错
    Bitex
        6
    Bitex  
    OP
       2015-03-11 08:24:13 +08:00 via iPhone
    @loveminds Release目录里有这个文件
    wusibacg
        7
    wusibacg  
       2015-03-11 08:30:28 +08:00 via Android
    希望添加组合键切换功能。
    Bitex
        8
    Bitex  
    OP
       2015-03-11 08:34:29 +08:00 via iPhone
    @loveminds 下载地址已经更新,请参阅append
    Bitex
        9
    Bitex  
    OP
       2015-03-11 08:35:04 +08:00 via iPhone
    @wusibacg mark,之后会试着加上这个功能
    shiye515
        10
    shiye515  
       2015-03-11 10:29:29 +08:00   ❤️ 1
    用着不错,支持!
    sNullp
        11
    sNullp  
       2015-03-11 10:38:33 +08:00 via iPhone   ❤️ 1
    赞!
    能设定输出位宽和采样率就完美了
    Bitex
        12
    Bitex  
    OP
       2015-03-11 11:19:03 +08:00
    @sNullp 那样就复杂了。我想做的就是一个方便切换的列表,如果需要设置位宽和采样率的话之后会考虑为设备添加右键菜单,方便进入设备属性。
    maxthonzx
        13
    maxthonzx  
       2015-03-11 11:26:01 +08:00   ❤️ 1
    支持一下 感觉以后会用得着
    sNullp
        14
    sNullp  
       2015-03-11 11:38:17 +08:00
    @Bitex 呃。。可以预先存成不同的 profile 这样。。像我这样用外接 DAC 的人很需要这个。。
    Bitex
        15
    Bitex  
    OP
       2015-03-11 11:44:00 +08:00
    @sNullp 呃……因为我对音频这方面没什么了解,所以我自己的需求很简单……我去了解一下,尽可能满足你的需求
    loveminds
        16
    loveminds  
       2015-03-11 16:07:47 +08:00
    @Bitex 这种东西最好还是不要做成太多文件,一般都是直接丢system32
    loveminds
        17
    loveminds  
       2015-03-11 16:10:52 +08:00
    @Bitex 另外我可以建议在点击设备名称的时候对应的设备发出咚响,以便于区分
    maxthonzx
        18
    maxthonzx  
       2015-06-27 00:52:33 +08:00
    win7 x64 使用最新版v1.3 依然提示“缺少MSVCP120D.dll”
    drakex
        19
    drakex  
       2018-10-11 15:42:25 +08:00
    这个实用的小软件,我是寻找了很久才发现啊。真是相见恨晚啊~~~

    希望作者以后还能继续开发啊!
    1.切换设备背景是否能加深一下呢??现在看着不是很明显啊!!!
    2.能添加一个启动开关,这样能让 win7 系统开机后能自动加载启动。
    3.添加个设备音量条这个调起来能更加方便。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3121 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:18 · PVG 08:18 · LAX 17:18 · JFK 20:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.