Ticket #3443: page.music.php.diff
| File page.music.php.diff, 1.6 kB (added by mickecarlsson, 3 years ago) |
|---|
-
page.music.php
old new 156 156 global $path_to_dir; 157 157 $pattern = ''; 158 158 $handle=opendir($path_to_dir) ; 159 $extensions = array('mp3',' wav'); // list of extensions to match159 $extensions = array('mp3','MP3','wav','WAV'); // list of extensions to match 160 160 161 161 //generate the pattern to look for. 162 162 $pattern = '/(\.'.implode('|\.',$extensions).')$/i'; … … 204 204 $newname = substr($mohfile,0,strrpos($mohfile,".")); 205 205 206 206 // If we are dealing with an MP3, we need to decode it to a wav file 207 if (strpos($origmohfile,'.mp3') !== false) {207 if (strpos($origmohfile,'.mp3') | strpos($origmohfile,'.MP3') !== false) { 208 208 $mpg123cmd = "mpg123 -w \"".substr($origmohfile,0,strrpos($origmohfile,".")).".wav\" \"".$origmohfile."\" 2>&1 "; 209 209 exec($mpg123cmd, $output, $returncode); 210 210 } 211 211 $newmohfile = $path_to_dir."/wav_".$newname.".wav"; 212 212 //asdf 213 $soxcmd = "sox \"". substr($origmohfile,0,strrpos($origmohfile,".")).".wav\"";213 $soxcmd = "sox \"".$origmohfile."\""; 214 214 $soxcmd .= " -r 8000 -c 1 \"".$newmohfile."\""; 215 215 if($volume){ 216 216 $soxcmd .= " vol ".$volume; … … 259 259 // If this started as an mp3, we converted it to a wav and then transcoded it from there, 260 260 // so we have two "original" files to delete 261 261 // 262 if (strpos($origmohfile,'.mp3') !== false) {262 if (strpos($origmohfile,'.mp3') | strpos($origmohfile,'.MP3') !== false) { 263 263 $rmcmd="rm -f \"". substr($origmohfile,0,strrpos($origmohfile,".")).".wav\""; 264 264 exec($rmcmd); 265 265 }
