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);
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;
// 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;
}
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;
}
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";
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)),
}
}
-
-?>
\ No newline at end of file