Tools.php

From SoundDB
Revision as of 21:11, 17 August 2012 by Admin (talk | contribs) (Created page with "<syntaxhighlight lang="php"> <?php function wavToCaf($input) { $output = str_replace(".wav", ".caf", $input); $cmd = "afconvert -f caff -d ima4@22050 -c 1 " . $input . " " . $...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<syntaxhighlight lang="php"> <?php

function wavToCaf($input) { $output = str_replace(".wav", ".caf", $input); $cmd = "afconvert -f caff -d ima4@22050 -c 1 " . $input . " " . $output; echo "Processing: ". $cmd . "\n"; exec($cmd); }

$filelist = scandir(getcwd());

foreach ($filelist as $key => $filename) { if (strpos($filename, ".wav") !== false) { wavToCaf($filename); } }

?>

</synthxhigtlight>