Skip to content

Commit

Permalink
Убрал конвертацию средствами asterisk
Browse files Browse the repository at this point in the history
'alaw', 'ulaw', 'gsm', 'g722', 'wav'
это значительно могло ухудшать качество записи.
  • Loading branch information
boffart committed Aug 28, 2024
1 parent 012182e commit b8f91d9
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/PBXCoreREST/Lib/System/ConvertAudioFileAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ public static function main(string $filename): PBXApiResult
Processes::mwExec("$lamePath -b 16 --silent '$n_filename' '$n_filename_mp3'", $out);
$result_mp3 = implode('', $out);

// Convert the file to various codecs using Asterisk
$codecs = ['alaw', 'ulaw', 'gsm', 'g722', 'wav'];
$rmPath = Util::which('rm');
$asteriskPath = Util::which('asterisk');
foreach ($codecs as $codec){
$result = shell_exec("$asteriskPath -rx 'file convert $tmp_filename $trimmedFileName.$codec'");
if(strpos($result, 'Converted') !== 0){
shell_exec("$rmPath -rf $trimmedFileName.$codec");
}
}

// Remove temporary file
unlink($tmp_filename);
if ($result_str !== '' && $result_mp3 !== '') {
Expand Down

0 comments on commit b8f91d9

Please sign in to comment.