https://github.com/mathsgod/microsoft-tts
https://github.com/mathsgod/microsoft-tts
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathsgod/microsoft-tts
- Owner: mathsgod
- License: mit
- Created: 2023-07-04T07:59:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T09:06:41.000Z (almost 3 years ago)
- Last Synced: 2025-03-13T09:03:24.952Z (over 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Microsoft TTS
## Installation
```bash
composer require mathsgod/microsoft-tts
```
## Usage
```php
use Microsoft\CognitiveServices\Speech\TTS;
require __DIR__ . '/vendor/autoload.php';
$region="eastasia";
$key='YOUR_KEY';
$tts = new TTS($key, $region);
$tts->save('Hello World', 'hello-world.mp3');
```
### Format and Voice
```php
$format=TTS::AUDIO_24KHZ_160KBITRATE_MONO_MP3;
$voice="zh-HK-HiuGaaiNeural";
$tts->save('Hello World', 'hello-world.mp3', $format, $voice);
```
### Get voices list
```php
$voices=$tts->getVoicesList();
```