Jump to content

ccieandrew

New Members
  • Posts

    5
  • Joined

  • Last visited

ccieandrew's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much for your help. This is the exact syntax that I need.
  2. based on the var_dump object(Att\Api\Speech\SpeechResponse)#8 (3) { ["_responseId":"Att\Api\Speech\SpeechResponse":private]=> string(32) "0135b50eb1a47009d4ef5af98bce7c9a" ["_status":"Att\Api\Speech\SpeechResponse":private]=> string(2) "OK" ["_NBest":"Att\Api\Speech\SpeechResponse":private]=> object(Att\Api\Speech\NBest)#7 (7) { ["_hypothesis":"Att\Api\Speech\NBest":private]=> string(14) "Boston Celtics" ["_languageId":"Att\Api\Speech\NBest":private]=> string(5) "en-US" ["_confidence":"Att\Api\Speech\NBest":private]=> float(0.239999995) ["_grade":"Att\Api\Speech\NBest":private]=> string(6) "accept" ["_resultText":"Att\Api\Speech\NBest":private]=> string(15) "Boston Celtics." ["_words":"Att\Api\Speech\NBest":private]=> array(2) { [0]=> string(6) "Boston" [1]=> string( "Celtics." } ["_wordScores":"Att\Api\Speech\NBest":private]=> array(2) { [0]=> float(0.239) [1]=> float(0.239) } } } The responseId and Status are strings. But NBest is an Object which hold hypothesis, resulttext, etc There is a funtion getNBest (SpeechResponse.php) The file NBest.php has a function getHypothesis() and getResultText(). I'm guessing the call would be something like echo $response->getNBest[NBest.ResultText]; No error but just blank display. I can't figure out the syntax Thanks for your help.
  3. Thanks for the info. Attached show the method on the object. I was able to use the code below to display responseid and status. But not the others including the resulttext. echo 'responseId: ' . $response->getResponseId() . "<br \>"; echo 'status: ' . $response->getStatus() . "<br \>"; I tried echo 'nBest: ' . $response->getNBest(ResultText); but I got an error that it's not a string.... Can you help me with the proper syntax. Thanks NBest.php SpeechResponse.php
  4. I have a code where the result for $response is object(Att\Api\Speech\SpeechResponse)#8 (3) { ["_responseId":"Att\Api\Speech\SpeechResponse":private]=> string(32) "0135b50eb1a47009d4ef5af98bce7c9a" ["_status":"Att\Api\Speech\SpeechResponse":private]=> string(2) "OK" ["_NBest":"Att\Api\Speech\SpeechResponse":private]=> object(Att\Api\Speech\NBest)#7 (7) { ["_hypothesis":"Att\Api\Speech\NBest":private]=> string(14) "Boston Celtics" ["_languageId":"Att\Api\Speech\NBest":private]=> string(5) "en-US" ["_confidence":"Att\Api\Speech\NBest":private]=> float(0.239999995) ["_grade":"Att\Api\Speech\NBest":private]=> string(6) "accept" ["_resultText":"Att\Api\Speech\NBest":private]=> string(15) "Boston Celtics." ["_words":"Att\Api\Speech\NBest":private]=> array(2) { [0]=> string(6) "Boston" [1]=> string( "Celtics." } ["_wordScores":"Att\Api\Speech\NBest":private]=> array(2) { [0]=> float(0.239) [1]=> float(0.239) } } } I would like to be able to display responseId: "ee1996d19d959aa0acac6d0240159b6e" status: "OK" hypothesis: "boston celtics" languageId: "en-US" grade: "accept" resultText: "Boston celtics." I'm trying echo $response->resultText but it doesn't work Help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.