protocol = new $protocolClass($options); } // end of member function __construct /** * Send a file to the diarization * * @param string path Path of the file to send to the diarization * @return void * @access public */ public function sendFile( $path ) { if (file_exists($path)) { $result = json_decode($this->protocol->postFile($path)); if ($result->status != "uploaded") { throw new Exception("Diarization error !",VOXILAB_DIARIZATION_ERROR); } $speechfile = new voxilabSpeechfile($result->id, $this); return $speechfile; } else throw new Exception("File ".$path." doesn't exist !",VOXILAB_FILE_DOESNT_EXIST); } // end of member function sendFile /** * Get file with an id * * @param int id File identifier * @return voxilabSpeechfile */ public function getFile($id) { return new voxilabSpeechfile($id, $this); } /** * Send a command to the protocol * * @param string command Name of the command to send * @return array */ public function sendCommand($id, $command) { return json_decode($this->protocol->command($id, $command)); } } // end of voxilabDiarization ?>