also looking at this
meemalabs/laravel-text-to-speech
feat: add 60db text-to-speech driver
#46
5 files
+403
-9
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | |
| 13 | 13 | This is a Text-To-Speech package for Laravel. Its primary intention is to use a shared API to easily convert text to speech. |
| 14 | 14 | |
| 15 | Currently, the only supported driver is Amazon Polly. We are exploring the option to soon support Google WaveNet. Feel free to start a discussion on any possible driver. | |
| 15 | Supported drivers are Amazon Polly and 60db. We are exploring the option to soon support Google WaveNet. Feel free to start a discussion on any possible driver. | |
| 16 | 16 | |
| 17 | 17 | ## 💡 Usage |
| 18 | 18 | |
| @@ -59,6 +59,27 @@ $output = TextToSpeech::speechMarks(['sentence', 'word', 'viseme', 'ssml']) | ||
| 59 | 59 | ->convert('This is a test'); // This will return an array. |
| 60 | 60 | ``` |
| 61 | 61 | |
| 62 | ### 60db text-to-speech | |
| 63 | ||
| 64 | Set `TTS_DRIVER=sixtydb`, `SIXTYDB_API_KEY`, and `SIXTYDB_VOICE_ID` to an available | |
| 65 | workspace voice ID. Optionally set `SIXTYDB_MODEL_ID`. Publish the package config | |
| 66 | again or add `services.sixtydb` from `config/config.php` to your existing config. | |
| 67 | ||
| 68 | ```php | |
| 69 | TextToSpeech::engine('sixtydb')->saveTo('speech.wav')->convert('Hello world', [ | |
| 70 | 'speed' => 1.0, | |
| 71 | ]); | |
| 72 | ``` | |
| 73 | ||
| 74 | The driver uses the existing source, disk and filename APIs and saves mono | |
| 75 | PCM16 WAV at 24 kHz. Use `.wav` output paths. `voice`, `speed` (0.5–2.0), and | |
| 76 | `model` can be overridden per conversion; `language('en-US')` sends `en` as the | |
| 77 | 60db target language. Input must be plain UTF-8 text, 1–5000 characters; SSML and | |
| 78 | other output formats are rejected. JSON, NDJSON and binary audio responses are | |
| 79 | supported, with bounded response reads and HTTP errors raised before storage. | |
| 80 | The driver requires a 60db API key and uploads text to the | |
| 81 | [60db synthesis API](https://docs.60db.ai/api-reference/tts/text-to-speech). | |
| 82 | ||
| 62 | 83 | ## 🐙 Installation |
| 63 | 84 | |
| 64 | 85 | You can install the package via composer: |