|
Hey, everyone. I'm very new to php and am having some trouble getting this script I found on github to work: https://github.com/purdy/aws-transcribe-transcript From what I understand, you're meant to be able to use this script on a .JSON file that is output from Amazon's transcribe service to make it readable instead of putting the transcription at the top of a document and the timecodes/speaker identifications at the bottom. So here's what I've done so far. 1) I downloaded XAMPP and started an Apache server. 2) I placed the file to be transcribed (the JSON file) and the github script (transcript.php) in the same subfolder of the XAMPP directory. 3) I renamed the JSON file to "asrOutput.json" in accordance with what I believe the instructions specified in the github page. 4) I ran the following command in my browser: http://localhost/Transcripts/transcript.php 5) I received the following error message in my browser: Notice: Undefined variable: argv in C:\xampp\htdocs\Transcripts\transcript.php on line 3 Warning: file_get_contents(): Filename cannot be empty in C:\xampp\htdocs\Transcripts\transcript.php on line 4 Notice: Trying to get property 'results' of non-object in C:\xampp\htdocs\Transcripts\transcript.php on line 8 Notice: Trying to get property 'speaker_labels' of non-object in C:\xampp\htdocs\Transcripts\transcript.php on line 8 Notice: Trying to get property 'segments' of non-object in C:\xampp\htdocs\Transcripts\transcript.php on line 8 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Transcripts\transcript.php on line 10 Notice: Trying to get property 'results' of non-object in C:\xampp\htdocs\Transcripts\transcript.php on line 17 Notice: Trying to get property 'items' of non-object in C:\xampp\htdocs\Transcripts\transcript.php on line 17 Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Transcripts\transcript.php on line 22 6) I have also tried running the following command, based again off the instructions in the github: http://localhost/Transcripts/transcript.php asrOutput.json Note the space between transcript.php and asrOutput.json. This time I received an Object Not Found error. 7) I tried executing the PHP from the command prompt, as well, but that just opened up the file in my text browser, so I may not have been using the correct method. At this point I'm really stumped. Any help would be greatly appreciated, thank you in advance!
|
# ? Aug 17, 2018 11:47 |
|
|
# ? Apr 18, 2024 04:25 |
|
That script is supposed to be run from the command line not from a web server. Also you only need PHP and not apache/mysql/whatever else comes with xampp, but that's not a big deal I guess. I'm assuming that the problem when you tried to run it from the command line is that xampp doesn't set up the windows environment path stuff properly. From a windows command prompt just do code:
This assumes that the C:\xampp... path is where your xampp/php installation is, you might have to figure out where it put php.exe yourself.
|
# ? Aug 17, 2018 14:09 |
|
astr0man posted:That script is supposed to be run from the command line not from a web server. Also you only need PHP and not apache/mysql/whatever else comes with xampp, but that's not a big deal I guess. I'm assuming that the problem when you tried to run it from the command line is that xampp doesn't set up the windows environment path stuff properly. I'll be damned, that worked like a charm! Thanks a million!
|
# ? Aug 17, 2018 22:05 |