Hi, I realize this may not be the best message board for this question, so if you know of a better one please let me know…
Here’s my problem - I’m trying to grab a .wav file and make an MP3 out of it using the program sox. However, the directory which has the .wav files also has .WAV files. A .WAV file is MS wav format, gsm encoded (wav49) and is encoded differently than .wav file which is MS wav format, 16 bit linear.
Anyway, what I want to grab is the .wav file and it’s grabbing the WAV file. The code is below. I tried changing the second line to
$wav = $fl[0].”.WAV”;
but that didn’t do it. I don’t really know PHP - I’m just modifying someone else’s code. Does anyone know what I need to do to grab the right file or a different message board where I should post my question? Thanks.
function getMP3File($d, $file, $props, $device, $mailbox, $vm_config, $vm_name, $context) {
$fl = split(“.”,$file);
$wav = $fl[0].“.wav”;
$uid = $fl[0].“.”.sha1($props[‘origtime’]. $props[‘callerchan’].$props[‘duration’]);
$mp3 = $uid.‘.mp3’;
if (!file_exists($d . $mp3)) {//generate mp3 file if it doesn’t exist
$cid = getCallerIDArray($props[‘callerid’]);
$title = ’ --tt “Message from ‘. $cid[0]. ’ ph# ’ . $cid[1] .’”‘;
$artist = ’ --ta "’. $cid[0].‘"’;
$album = ’ --tl “'. $vm_config[$context][$device][1] . ‘'s mailbox ’ . $mailbox .’ at ’ . $vm_name . '”‘;
$comment = ’ --tc “Generated by LifeOnRecord Feeder http://www.LifeOnRecord.com”’;
system(‘/usr/bin/lame -h --nspsytune --athtype 2 --lowpass 11 --ns-bass -8 --scale 0.93 --cbr -b 96 --resample 22.05 --add-id3v2’ . $title . $artist . $album . $comment . ’ ’ . $d . $wav . ’ ’ . $d . $mp3 .’ &');
}
return $uid;
}