1,如果是windows下

试试这个python 模块winsound
http://docs.python.org/2/library/winsound.html
这个也可以
winmm调整windows系统的音量大小

http://www.oschina.net/code/snippet_72895_5978



2,#coding=utf-8
from ctypes import windll
WM_APPCOMMAND = 0x319
APPCOMMAND_VOLUME_UP = 0x0a
APPCOMMAND_VOLUME_DOWN = 0x09
APPCOMMAND_VOLUME_MUTE = 0x08
hwnd=windll.user32.GetForegroundWindow()
windll.user32.PostMessageA(hwnd,WM_APPCOMMAND,0,APPCOMMAND_VOLUME_MUTE*0x10000)


3,win32gui

使用pip install win32gui  安装



相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案