We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 660bdfc commit f88894cCopy full SHA for f88894c
speech/src/transcribe_sync.php
@@ -44,7 +44,8 @@
44
$languageCode = 'ar-EG';
45
46
// get contents of a file into a string
47
-$content = $_POST['file'];
+// $content = $_POST['file'];
48
+$content = file_get_contents("php://input");
49
50
// set string as audio content
51
$audio = (new RecognitionAudio())
@@ -67,7 +68,9 @@
67
68
$transcript = $mostLikely->getTranscript();
69
$confidence = $mostLikely->getConfidence();
70
printf('Transcript: %s' . PHP_EOL, $transcript);
- echo json_encode($transcript);
71
+ $result = new Array();
72
+ $result['result'] = htmlentities((string)$transcript);
73
+ echo json_encode($result);
74
break;
75
// printf('Confidence: %s' . PHP_EOL, $confidence);
76
}
0 commit comments