V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
zictos
V2EX  ›  Python

自己写的 windows 程序如何独占扬声器(播放音乐时其他程序正在播放的音乐自动暂时无声)?

  •  
  •   zictos · 2020-09-22 08:41:26 +08:00 · 2044 次点击
    这是一个创建于 1305 天前的主题,其中的信息可能已经有所发展或是发生改变。

    打算定时在电脑上播放一段声音,但有时候其他程序正在听音乐或看视频时其他程序的音乐会对定时播放的声音造成干扰。

    打算用 python 写,但不仅限于 python,重点是一个思路。可能重点在于 windows api 之类的,不知道要用到什么 api

    从 windows 的设置中可以看到 windows 是允许应用程序独占音频设备的:

    avatar

    3 条回复    2020-09-22 10:00:16 +08:00
    ungrown
        1
    ungrown  
       2020-09-22 08:54:57 +08:00
    不知道,但你不妨试试 QT ( pyqt5,pyside2 ),搜搜看 QT 框架内有没有现成的 API 能实现你的需求
    毕竟 QT 早已不是单纯的 GUI 框架,而已是跨平台的操作系统接口封装集
    mxalbert1996
        3
    mxalbert1996  
       2020-09-22 10:00:16 +08:00 via Android   ❤️ 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5201 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:22 · PVG 16:22 · LAX 01:22 · JFK 04:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.