22 lines
520 B
PHP
22 lines
520 B
PHP
<?php
|
|
|
|
function killPlayingSong() {
|
|
system("killall -q mpg321");
|
|
}
|
|
|
|
function setSystemVolume($newvol = null) {
|
|
if ( is_null($newvol) ) return false;
|
|
system("HOME=/home/web && /usr/bin/amixer -q sset Master " . $newvol);
|
|
file_put_contents("/tmp/curvol", $newvol);
|
|
return true;
|
|
}
|
|
|
|
function getSystemVolume() {
|
|
$curvol = file_get_contents("/tmp/curvol");
|
|
//$curvol = trim(shell_exec("HOME=/home/web && /usr/bin/amixer sget Master | grep \"Front Left:\" | awk '{print $4}'"));
|
|
return $curvol;
|
|
}
|
|
|
|
|
|
?>
|