Skip to content

Instantly share code, notes, and snippets.

View jacobischwartz's full-sized avatar

Jacob Schwartz jacobischwartz

View GitHub Profile
@jacobischwartz
jacobischwartz / texttospeech.php
Created January 25, 2018 00:20
How to use Amazon Polly in PHP to speak some text and save to mp3 file
<?php
try {
// This should be gitignored. Define your API credentials in it. Get the credentials from AWS IAM. Should have full Polly permissions.
require_once 'vendor/aws.config.php';
// The official AWS SDK for PHP, version 3. See https://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html
require_once "vendor/aws.phar";