1,如果是windows下
试试这个python 模块winsoundhttp://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 安装