public function it_processes_speech_recognition_with_speechkit_api(SpeechContentInterface $speech, ResponseInterface $response, UploaderInterface $uploader, ResponseParserInterface $responseParser) { $uploader->upload($speech)->willReturn($response); $responseParser->parse($response)->willReturn('hyphoteses list'); $this->recognize($speech)->shouldReturn('hyphoteses list'); }
/** * Runs recognition of given speech. Returns list of hyphoteses in same order as SpeechKit API returned. * @param SpeechContentInterface $speech * @return HypothesesList */ public function recognize(SpeechContentInterface $speech) { $response = $this->uploader->upload($speech); return $this->responseParser->parse($response); }