'lame', 'sfl' => 1, 'auf' => 'audio/L16;rate=16000', 'vcn' => 'xiaoyan', 'speed' => 50, 'volume' => 50, 'pitch' => 50, 'bgs' => 0, 'tte' => 'UTF8', 'reg' => '2', 'rdn' => '0', 'ent' => '' ]; $this->aue = $config['aue']; $this->sfl = $config['sfl']; $this->auf = $config['auf']; $this->vcn = $config['vcn']; $this->speed = $config['speed']; $this->volume = $config['volume']; $this->pitch = $config['pitch']; $this->bgs = $config['bgs']; $this->tte = $config['tte']; $this->reg = $config['reg']; $this->rdn = $config['rdn']; $this->ent = $config['ent']; } /** * 去除null项后返回数组形式 * * @return array */ public function toArray() { return $this->removeNull([ 'aue' => $this->aue, 'sfl' => $this->sfl, 'auf' => $this->auf, 'vcn' => $this->vcn, 'speed' => $this->speed, 'volume' => $this->volume, 'pitch' => $this->pitch, 'bgs' => $this->bgs, 'tte' => $this->tte, 'reg' => $this->reg, 'rdn' => $this->rdn, 'ent' => $this->ent ]); } /** * 返回toArray的Json格式 * * @return string */ public function toJson() { return $this->jsonEncode($this->toArray()); } }