Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
TwoSheds
Sep 12, 2007

Bringer of sugary treats!
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!

Adbot
ADBOT LOVES YOU

astr0man
Feb 21, 2007

hollyeo deuroga
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:
C:\xampp\php\php.exe transcript.php your_amazon_file.json
from the directory containing your transcript.php script and your json file.

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.

TwoSheds
Sep 12, 2007

Bringer of sugary treats!

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.

From a windows command prompt just do

code:
C:\xampp\php\php.exe transcript.php your_amazon_file.json
from the directory containing your transcript.php script and your json file.

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.

I'll be damned, that worked like a charm! Thanks a million!

  • Locked thread