Skip to content

Commit f88894c

Browse files
committed
change
1 parent 660bdfc commit f88894c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

speech/src/transcribe_sync.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
$languageCode = 'ar-EG';
4545

4646
// get contents of a file into a string
47-
$content = $_POST['file'];
47+
// $content = $_POST['file'];
48+
$content = file_get_contents("php://input");
4849

4950
// set string as audio content
5051
$audio = (new RecognitionAudio())
@@ -67,7 +68,9 @@
6768
$transcript = $mostLikely->getTranscript();
6869
$confidence = $mostLikely->getConfidence();
6970
printf('Transcript: %s' . PHP_EOL, $transcript);
70-
echo json_encode($transcript);
71+
$result = new Array();
72+
$result['result'] = htmlentities((string)$transcript);
73+
echo json_encode($result);
7174
break;
7275
// printf('Confidence: %s' . PHP_EOL, $confidence);
7376
}

0 commit comments

Comments
 (0)