PHPackages                             tbetool/ibm-watson-tts - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tbetool/ibm-watson-tts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tbetool/ibm-watson-tts
======================

Based on IBM Watson. Text to Speech serializer

v1.5(7y ago)6488↓100%2[2 issues](https://github.com/TBETool/ibm-watson-tts-php/issues)PHPPHP &gt;=5.5

Since May 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/TBETool/ibm-watson-tts-php)[ Packagist](https://packagist.org/packages/tbetool/ibm-watson-tts)[ Docs](http://thebornenginner.com)[ RSS](/packages/tbetool-ibm-watson-tts/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

IBM Watson Text-To-Speech PHP Library
-------------------------------------

[](#ibm-watson-text-to-speech-php-library)

Convert written text into natural-sounding audio in a variety of languages and voices.
This package use [IBM Watson Text To Speech](https://www.ibm.com/watson/services/text-to-speech/) service.

---

### Using the Library

[](#using-the-library)

#### Installation

[](#installation)

Intall library in PHP project using composer

```
composer require tbetool/ibm-watson-tts

```

#### Using Library

[](#using-library)

After installing the library, create `WatsonTts` object

```
$watson = new WatsonTts(
    'watson_username',
    'watson_password',
    'watson_url'
);

```

Watson `username, password, url` can be obtained by creating an instance of service. For more detail follow [Getting Started Guide](https://console.bluemix.net/docs/services/text-to-speech/getting-started.html#gettingStarted).

#### 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';

$watson->setOutputPath($path);

```

#### Convert Text to Speech

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

Pass text to convert to speech.

```
$file = $watson->tts('Hello World');

```

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 {
    $watson->setAudioFormat('mp3');
} catch (Exception $exception) {
    echo $exception->getMessage();
}

```

will throw and exception `Not a valid audio format. Allowed formats: wav, ogg` as `mp3` audio format is not supported as of now

---

### Other callable methods

[](#other-callable-methods)

##### Set Audio Format

[](#set-audio-format)

```
$watson->setAudioFormat('wav');

```

*allowed formats:* `wav`, `ogg`
*default:* `wav`

##### Set Language

[](#set-language)

```
$watson->setLanguage('en-US');

```

*allowed languages:* [See List](#supported-language-and-voice-list) *default:* `en-US`

##### Set Voice

[](#set-voice)

```
$watson->setVoice('MichaelVoice');

```

*allowed voices:* [See List](#supported-language-and-voice-list)
*default:* `MichaelVoice`

---

### Supported language and voice list

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

list of supported language and voice strings

Namelanguagevoicegenderdescriptiones-LA\_SofiaVoice**es-LA****SofiaVoice**femaleSofia: Latin American Spanish (español latinoamericano) female voice.pt-BR\_IsabelaVoice**pt-BR****IsabelaVoice**femaleIsabela: Brazilian Portuguese (português brasileiro) female voice.en-GB\_KateVoice**en-GB****KateVoice**femaleKate: British English female voice.de-DE\_BirgitVoice**de-DE****BirgitVoice**femaleBirgit: Standard German of Germany (Standarddeutsch) female voice.en-US\_AllisonVoice**en-US****AllisonVoice**femaleAllison: American English female voice.fr-FR\_ReneeVoice**fr-FR****ReneeVoice**femaleRenee: French (français) female voice.it-IT\_FrancescaVoice**it-IT****FrancescaVoice**femaleFrancesca: Italian (italiano) female voice.es-ES\_LauraVoice**es-ES****LauraVoice**femaleLaura: Castilian Spanish (español castellano) female voice.ja-JP\_EmiVoice**ja-JP****EmiVoice**femaleEmi: Japanese (日本語) female voice.es-ES\_EnriqueVoice**es-ES****EnriqueVoice**maleEnrique: Castilian Spanish (español castellano) male voice.de-DE\_DieterVoice**de-DE****DieterVoice**maleDieter: Standard German of Germany (Standarddeutsch) male voice.en-US\_LisaVoice**en-US****LisaVoice**femaleLisa: American English female voice.en-US\_MichaelVoice**en-US****MichaelVoice**maleMichael: American English male voice.es-US\_SofiaVoice**es-US****SofiaVoice**femaleSofia: North American Spanish (español norteamericano) female voice.---

### Bug Reporting

[](#bug-reporting)

If you found any bug, create an [issue](https://github.com/TBETool/ibm-watson-tts-php/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 60% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~5 days

Total

6

Last Release

2886d 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 (4 commits)")

---

Tags

ibm-watson-servicesibm-watson-speechtext-to-speechttswatson-natural-languagetext-to-speechibmAnuj SharmaTBEAnuj TBEwatsonibm watsonibm watson ttswatson text to speechibm watson text to speechibm watson tts serializeribm watson text to speech serializerwatson ttswatson tts phpwatson text to speech php library

### Embed Badge

![Health badge](/badges/tbetool-ibm-watson-tts/health.svg)

```
[![Health](https://phpackages.com/badges/tbetool-ibm-watson-tts/health.svg)](https://phpackages.com/packages/tbetool-ibm-watson-tts)
```

###  Alternatives

[duncan3dc/speaker

Convert text to speech using web services

11539.1k1](/packages/duncan3dc-speaker)[werd/ivona-speechcloud-sdk-php

IVONA SpeechCloud SDK for PHP

102.1k](/packages/werd-ivona-speechcloud-sdk-php)

PHPackages © 2026

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