X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=app%2Fdata%2Fmodules%2Fshare%2Fsml_data_waveforms.php;h=306cb8b61e855d0400840f31f66462f6afd86e25;hb=HEAD;hp=d492a4689ca7e54b5861375f68dd51e7ff4fb01b;hpb=80964d99dd2b63fda9276903d72537091e04ba17;p=mw_sourceml diff --git a/app/data/modules/share/sml_data_waveforms.php b/app/data/modules/share/sml_data_waveforms.php index d492a46..306cb8b 100644 --- a/app/data/modules/share/sml_data_waveforms.php +++ b/app/data/modules/share/sml_data_waveforms.php @@ -2,9 +2,9 @@ class sml_data_waveforms extends mw_data{ - var $SOX_EXISTS; + public $SOX_EXISTS; - function init_waveform_dirs(){ + public function init_waveform_dirs(){ $env = $this->env(); $dir = $env->path("content")."tmp"; if(!is_dir($dir)) @mkdir($dir); @@ -15,7 +15,7 @@ return true; } - function audio_to_png($params = array()){ + public function audio_to_png($params = array()){ $env = $this->env(); $audio_file = $params["audio_file"]; if(!$audio_file) return false; @@ -91,11 +91,11 @@ // utilitaires // - function sox_command($audio_file, $wav_file){ - return "sox -V \"".$audio_file."\" -r 8000 -c 1 \"".$wav_file."\""; + public function sox_command($audio_file, $wav_file){ + return "sox -V \"".$audio_file."\" -b 16 -r 8000 -c 1 \"".$wav_file."\""; } - function sox_exists(){ + public function sox_exists(){ if(isset($this->SOX_EXISTS)){ return $this->SOX_EXISTS; } @@ -127,7 +127,7 @@ return $this->SOX_EXISTS; } - function audio_to_wav($audio_file, $wav_file){ + public function audio_to_wav($audio_file, $wav_file){ if(!$this->sox_exists()){ return false; } @@ -135,7 +135,7 @@ return file_exists($wav_file); } - function wav_to_img($wav_file, $params = array()){ + public function wav_to_img($wav_file, $params = array()){ $width = isset($params["width"]) ? $params["width"] : "650"; $height = isset($params["height"]) ? $params["height"] : "100"; @@ -244,11 +244,11 @@ return $img; } - function findValues($byte1, $byte2){ + public function findValues($byte1, $byte2){ return hexdec(bin2hex($byte1)) + (hexdec(bin2hex($byte2)) * 256); } - function html2rgb($input){ + public function html2rgb($input){ $input = $input[0] == "#" ? substr($input, 1, 6) : substr($input, 0, 6); return array( hexdec(substr($input, 0, 2)), @@ -258,5 +258,3 @@ } } - -?> \ No newline at end of file