Update app.py
Browse files
app.py
CHANGED
|
@@ -8,15 +8,4 @@ const result = await generateSpeech({
|
|
| 8 |
|
| 9 |
result.audio.uint8Array; // Uint8Array
|
| 10 |
result.audio.base64; // string (lazy)
|
| 11 |
-
result.audio.mediaType; // "audio/mpeg"
|
| 12 |
-
|
| 13 |
-
// 1. String → routes through Speech Gateway (https://api.speechgateway.com)
|
| 14 |
-
// Needs SPEECH_GATEWAY_API_KEY (sign up at https://speechgateway.com).
|
| 15 |
-
await generateSpeech({ model: 'openai/gpt-4o-mini-tts', text: '...', voice: 'alloy' });
|
| 16 |
-
|
| 17 |
-
// 2. Factory → calls the provider directly (no proxy hop)
|
| 18 |
-
// Reads the provider's env var (e.g. OPENAI_API_KEY), or pass apiKey to the factory.
|
| 19 |
-
import { createOpenAI } from '@speech-sdk/core/providers';
|
| 20 |
-
await generateSpeech({ model: createOpenAI()('gpt-4o-mini-tts'), text: '...', voice: 'alloy' });
|
| 21 |
-
|
| 22 |
-
|
|
|
|
| 8 |
|
| 9 |
result.audio.uint8Array; // Uint8Array
|
| 10 |
result.audio.base64; // string (lazy)
|
| 11 |
+
result.audio.mediaType; // "audio/mpeg"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|