start = $start; $this->duration = $duration; $this->speaker = $speaker; $this->getEnd(); } // end of member function __construct /** * Get the time at the end * * @return float * @access public */ public function getEnd( ) { if (!$this->end) { $this->end = $this->start + $this->duration; } return $this->end; } // end of member function getEnd public function __toString() { print "Segment [Start : ".$this->start.". End : ".$this->end.". Duration : ".$this->duration.". Speaker : ".$this->speaker->getID().".]
"; } public function getStart() { return $this->start; } public function getDuration() { return $this->duration; } public function getSpeaker() { return $this->speaker; } /** * Encode the segment into Json * @return string */ public function toJson() { $array = array( 'start' => $this->start, 'duration' => $this->duration, 'speaker' => array( 'id' => $this->speaker->getID(), 'gender' => $this->speaker->getGender() ) ); return json_encode($array); } } // end of voxilabSegment ?>