Add option to convert with sox
This commit is contained in:
parent
5d990aa0e7
commit
c702809b77
|
|
@ -32,7 +32,7 @@ crontab -e
|
||||||
$debug = true;
|
$debug = true;
|
||||||
$action = 'convert'; //convert, move or both
|
$action = 'convert'; //convert, move or both
|
||||||
$audio_format = 'wav';
|
$audio_format = 'wav';
|
||||||
$preferred_command = 'lame'; //mpg123, lame
|
$preferred_command = 'lame'; //mpg123, lame, sox
|
||||||
|
|
||||||
//includes files
|
//includes files
|
||||||
require_once "resources/require.php";
|
require_once "resources/require.php";
|
||||||
|
|
@ -99,6 +99,13 @@ crontab -e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (file_exists($source_path."/".$record_name)) {
|
if (file_exists($source_path."/".$record_name)) {
|
||||||
|
//build the run the sox command
|
||||||
|
if ($preferred_command == 'sox' && !file_exists($source_path."/".$path_parts['filename'].".mp3")) {
|
||||||
|
$command = "sox ".$source_path."/".$record_name." -C 128 ".$source_path."/".$path_parts['filename'].".mp3 \n";
|
||||||
|
if ($debug) { echo $command."\n"; }
|
||||||
|
system($command);
|
||||||
|
}
|
||||||
|
|
||||||
//build the run the mpg123 command
|
//build the run the mpg123 command
|
||||||
if ($preferred_command == 'mpg123' && !file_exists($source_path."/".$path_parts['filename'].".mp3")) {
|
if ($preferred_command == 'mpg123' && !file_exists($source_path."/".$path_parts['filename'].".mp3")) {
|
||||||
$command = "mpg123 -w ".$source_path."/".$record_name." ".$source_path."/".$path_parts['filename'].".mp3\n";
|
$command = "mpg123 -w ".$source_path."/".$record_name." ".$source_path."/".$path_parts['filename'].".mp3\n";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue