voice-router-dev 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +370 -202
- package/dist/index.d.ts +370 -202
- package/dist/index.js +1 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -144,39 +144,7 @@ var VoiceRouter = class {
|
|
|
144
144
|
const adapter = this.getAdapter(provider);
|
|
145
145
|
return adapter.getTranscript(transcriptId);
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
* Stream audio for real-time transcription
|
|
149
|
-
* Only works with providers that support streaming
|
|
150
|
-
*
|
|
151
|
-
* @param options - Streaming options including provider selection
|
|
152
|
-
* @param callbacks - Event callbacks for transcription results
|
|
153
|
-
* @returns Promise that resolves with a StreamingSession
|
|
154
|
-
*
|
|
155
|
-
* @example
|
|
156
|
-
* ```typescript
|
|
157
|
-
* import { VoiceRouter } from '@meeting-baas/sdk';
|
|
158
|
-
*
|
|
159
|
-
* const router = new VoiceRouter();
|
|
160
|
-
* router.initialize({
|
|
161
|
-
* gladia: { apiKey: process.env.GLADIA_KEY },
|
|
162
|
-
* deepgram: { apiKey: process.env.DEEPGRAM_KEY }
|
|
163
|
-
* });
|
|
164
|
-
*
|
|
165
|
-
* const session = await router.transcribeStream({
|
|
166
|
-
* provider: 'deepgram',
|
|
167
|
-
* encoding: 'linear16',
|
|
168
|
-
* sampleRate: 16000,
|
|
169
|
-
* language: 'en'
|
|
170
|
-
* }, {
|
|
171
|
-
* onTranscript: (event) => console.log(event.text),
|
|
172
|
-
* onError: (error) => console.error(error)
|
|
173
|
-
* });
|
|
174
|
-
*
|
|
175
|
-
* // Send audio chunks
|
|
176
|
-
* await session.sendAudio({ data: audioBuffer });
|
|
177
|
-
* await session.close();
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
147
|
+
// Implementation
|
|
180
148
|
async transcribeStream(options, callbacks) {
|
|
181
149
|
const provider = this.selectProvider(options?.provider);
|
|
182
150
|
const adapter = this.getAdapter(provider);
|