PHPackages                             tbetool/aws-polly - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tbetool/aws-polly

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

tbetool/aws-polly
=================

Based on Amazon AWS Polly. Text to Speech serializer

1.0.1(6y ago)08862[1 PRs](https://github.com/TBETool/aws-polly/pulls)PHPPHP &gt;=5.5

Since Aug 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/TBETool/aws-polly)[ Packagist](https://packagist.org/packages/tbetool/aws-polly)[ Docs](http://thebornenginner.com)[ RSS](/packages/tbetool-aws-polly/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

AWS Polly Text-To-Speech PHP Library
------------------------------------

[](#aws-polly-text-to-speech-php-library)

Convert written text into natural-sounding audio in a variety of languages and voices.
This package use [AWS Polly](https://aws.amazon.com/polly/) service.

---

### Using the Library

[](#using-the-library)

#### Installation

[](#installation)

Intall library in PHP project using composer

```
composer require tbetool/aws-polly

```

#### Using Library

[](#using-library)

After installing the library, create `WatsonTts` object

```
$polly = new AwsPolly(
    'aws_key',
    'aws_secret',
    'aws_region'
);

```

AWS `key, secret` can be obtained by creating IAM user in AWS console. For more detail follow [Creating IAM for Polly](#).

#### Setting output path

[](#setting-output-path)

Set absolute path of the directory where to save the output. You don't need to provide a file name as it will be auto generated.

```
$path = '/aboslute/path/to/directory';

$polly->setOutputPath($path);

```

**NOTE:** You can also pass output path with textToVoice() which will override this path

#### Convert Text to Speech

[](#convert-text-to-speech)

Pass text to convert to speech.

```
$file = $polly->textToVoice(
    'Hello World',
    $param
);

```

**$params** should be array and can have following content.

```
$param = [
    'language' => 'en-US',
    'voice' => 'Justin',
    'output_path' => '/absolute/file/path'
]

```

This will return the absolute path of the file created if text to speech conversion is successful, otherwise will throw Exception.

---

### Exception handling

[](#exception-handling)

Every function throws an Exception in case of any error/issue. Bind the code block within `try-catch` block to catch any exception occurred.

*Ex:*

```
try {
    $polly->textToVoice('Hello world');
} catch (Exception $exception) {
    echo $exception->getMessage();
}

```

---

### Other callable methods

[](#other-callable-methods)

##### Get supported languages

[](#get-supported-languages)

```
$polly->getLanguages();

```

*default:* `en-US`

##### Get supported voices

[](#get-supported-voices)

```
$polly->getVoices();

```

*default:* `Ivy`

---

### Supported language and voice list

[](#supported-language-and-voice-list)

list of supported language and voice strings

CountrylanguagevoicegenderDanish**da-DK****Mads**male**Naja**femaleDutch**nl-NL****Ruben**male**Lotte**femaleEnglish (Australian)**en-AU****Russell**male**Nicole**femaleEnglish (British)**en-GB****Brian**male**Amy**female**Emma**femaleEnglish (Indian)**en-IN****Aditi**female**Raveena**femaleEnglish (US)**en-US****Joey**male**Justin**male**Matthew**male**Ivy**female**Joanna**female**Kendra**female**Kimberly**female**Salli**femaleEnglish (Welsh)**en-GB-WLS****Geraint**maleFrench**fr-FR****Mathieu**male**Celine**female**Lea**femaleFrench (Canadian)**fr-CA****Chantal**femaleGerman**de-DE****Hans**male**Marlene**female**Vicki**femaleHindi**hi-IN****Aditi**femaleIcelandic**is-IS****Karl**male**Dora**femaleItalian**it-IT****Giorgio**male**Carla**femaleJapanese**ja-JP****Takumi**male**Mizuki**femaleKorean**ko-KR****Seoyeon**femaleNorwegian**nb-NO****Liv**femalePolish**pl-PL****Jacek**male**Jan**male**Ewa**female**Maja**femalePortuguese (Brazilian)**pt-BR****Ricardo**male**Vitoria**femalePortuguese (European)**pt-PT****Cristiano**male**Ines**femaleRomanian**ro-RO****Carmen**femaleRussian**ru-RU****Maxim**male**Tatyana**femaleSpanish (European)**en-ES****Enrique**male**Conchita**femaleSpanish (Latin American)**es-US****Miguel**male**Penelope**femaleSwedish**sv-SE****Astrid**femaleTurkish**tr-TR****Filiz**femaleWelsh**cy-GB****Gwyneth**female---

### Bug Reporting

[](#bug-reporting)

If you found any bug, create an [issue](https://github.com/TBETool/aws-polly/issues/new).

---

### Support and Contribution

[](#support-and-contribution)

Something is missing?

- `Fork` the repositroy
- Make your contribution
- make a `pull request`

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~623 days

Total

2

Last Release

2205d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6560085?v=4)[Anuj Sharma](/maintainers/anuj9196)[@anuj9196](https://github.com/anuj9196)

---

Top Contributors

[![anuj9196](https://avatars.githubusercontent.com/u/6560085?v=4)](https://github.com/anuj9196 "anuj9196 (6 commits)")[![creativejaved](https://avatars.githubusercontent.com/u/48195566?v=4)](https://github.com/creativejaved "creativejaved (1 commits)")

---

Tags

amazonawstext-to-speechamazon awsAnuj SharmaTBEAnuj TBEaws text to speechaws polly text to speechaws polly tts serializeraws polly ttsaws polly text to speech serializerpolly ttspolly tts phpaws polly text to speech php library

### Embed Badge

![Health badge](/badges/tbetool-aws-polly/health.svg)

```
[![Health](https://phpackages.com/badges/tbetool-aws-polly/health.svg)](https://phpackages.com/packages/tbetool-aws-polly)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[aws/aws-sdk-php-symfony

A Symfony bundle for v3 of the AWS SDK for PHP

36517.7M22](/packages/aws-aws-sdk-php-symfony)[aws/aws-sdk-php-resources

A resource-oriented API for interacting with AWS services

1381.8M10](/packages/aws-aws-sdk-php-resources)[vinelab/cdn

Content Delivery Network (CDN) Package for Laravel

217240.8k1](/packages/vinelab-cdn)[aws/aws-sdk-php-zf2

Zend Framework 2 Module that allows easy integration the AWS SDK for PHP

104997.5k5](/packages/aws-aws-sdk-php-zf2)[enqueue/sqs

Message Queue Amazon SQS Transport

376.3M14](/packages/enqueue-sqs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
