2016-01-16 101 views
0

我正在嘗試使用Lame和php包裝器phplame將.wav轉換爲.mp3。當我運行下面的腳本我收到以下內容:在ubuntu服務器上使用phplame時LAME執行錯誤代碼:255

string(151) "LAME execution error! command: `/usr/bin/lame --preset standard 'lametest.wav' 'lametest.mp3'`, error: `Can't init outfile 'lametest.mp3' `, code: 255" 

lametest.php:

<?php 
require 'vendor/autoload.php'; 

use Lame\Lame; 
use Lame\Settings; 

// encoding type 
$encoding = new Settings\Encoding\Preset(); 
$encoding->setType(Settings\Encoding\Preset::TYPE_STANDARD); 

// lame settings 
$settings = new Settings\Settings($encoding); 

// lame wrapper 
$lame = new Lame('/usr/bin/lame', $settings); 

try { 
    $lame->encode("lametest.wav", 
     "lametest.mp3"); 
} catch(\RuntimeException $e) { 
    var_dump($e->getMessage()); 
} 
?> 

回答

相關問題