linux下命令行方式的音量控制

时间:2025-03-27 07:52:48

输入命令:alsamixer;

//设置系统音量,这个百分比会有一定的误差存在
amixer set Speaker 100%
                
//设置系统麦克风
amixer set Mic 100%

c++代码可以执行运行上面的命令:

QString yl = "amixer set Speaker 100%";

    QByteArray cmd;
    (yl);     //也可以 ba2 = s2.toLatin1();
    const char *c_cmd = ();
    system(c_cmd);