mathsgod / microsoft-tts
Microsoft Text-to-Speech API for PHP
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/mathsgod/microsoft-tts
Requires
- guzzlehttp/guzzle: ^7.7
README
Installation
composer require mathsgod/microsoft-tts
Usage
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
$format=TTS::AUDIO_24KHZ_160KBITRATE_MONO_MP3; $voice="zh-HK-HiuGaaiNeural"; $tts->save('Hello World', 'hello-world.mp3', $format, $voice);
Get voices list
$voices=$tts->getVoicesList();