?token=YOUR_TOKEN
Whisper
VAD-filtered recording with batch transcription
Transcript
Text-to-Speech
Type or paste text, then click Speak to hear it. Or click the speaker icon on any transcript above.
Developer
Import WhisperClient into your own app — no build step required.
import { WhisperClient } from '/whisper-client.js';
// Create a client
const client = new WhisperClient({
server: window.location.origin, // default: same origin
token: 'your-hypha-token', // optional
model: 'small', // tiny | base | small | medium | large-v3
});
// Option A: Record from microphone with VAD
client.onChunkUploaded = (info) => console.log(info.chunks, info.totalBytes);
await client.startRecording();
const result = await client.stopRecording();
console.log(result.text);
// Option B: Live streaming — real-time utterance by utterance
client.onTranscript = (r) => console.log(`[${r.sequence}] ${r.text}`);
await client.startStreaming();
// ... speak, each utterance fires onTranscript ...
const summary = await client.stopStreaming();
// Option C: Transcribe an audio file directly
const result2 = await client.transcribe(audioBlob);
// Text-to-Speech — POST /api/tts
const resp = await fetch('/api/tts', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'Hello world', language: 'en', backend: 'edge-tts' }),
});
const audio = new Audio(URL.createObjectURL(await resp.blob()));
audio.play();
// Cleanup when done
client.destroy();
TypeScript types: /whisper-client.d.ts