asked on
PHP Script for AWS Poly Errors =
I am trying to develop a simple PHP that will read through a text file of Words and Phrases and then get a synthesized speech version of each entry from AWS Poly and finally save that response as an mp3 file for later processing by Audcity.
I found some sample code here - https://saturncloud.io/blog/how-to-implement-amazon-polly-using-php-sdk/
But after using the Composer to install the SDK as referenced a simple PHP -f myFile.php results in errors on the very first line. The use Aws\Polly\PollyClient; line,. So I went digging into the tree installed by Composer and found the file vendor/aws/aws-sdk-php/src/Polly/PollyClient.php and added it via a require but again had no luck.
Hoping someone can steer me in the right direction.
On siteground so there are some long directory paths.
so
<?php
require 'vendor/aws/aws-sdk-php/src/Polly/PollyClient.php';
use Aws\Polly\PollyClient;
.............
Fatal error: Uncaught Error: Class 'Aws\AwsClient' not found in /home/customer/www/dapage.net/aws/vendor/aws/aws-sdk-php/src/Polly/PollyClient.php:32
Stack trace:
#0 /home/customer/www/xxxxx.net/aws/awsPoly.php(3): require()
#1 {main}
thrown in /home/customer/www/xxxxx.net/aws/vendor/aws/aws-sdk-php/src/Polly/PollyClient.php on line 32
ASKER
Never Mind, Can't find the enum list so I just hardcoded it and it works ---
Thank you
ASKER
Well that certainly helped ---
Now I have a Uncaught Error: Class 'Aws\Polly\Enum\OutputFormat' --
Despite the - use Aws\Polly\Enum\OutputFormat;
So more digging. --