Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

realtime-typer

Real-time speech transcription using OpenAI's Realtime API - a demonstration of realtime transcription

Features

  • Real-time Transcription: Live speech-to-text conversion as you speak
  • Language Support: Transcribe in multiple languages (English, Spanish, French, German, Italian, Portuguese, Chinese, Japanese, Korean)
  • Delay Setting: Control transcription latency

How It Works

This app uses OpenAI's Realtime API in transcription-only mode:

  1. Your voice is captured via WebRTC
  2. Audio is streamed to OpenAI's transcription service
  3. Transcriptions are returned in real-time

Usage

  1. Click "Start" to begin transcription
  2. Allow microphone access when prompted
  3. Start speaking - transcriptions appear in real-time
  4. Click "Stop" to end the session

API Endpoints

  • GET / - Serves the transcription interface
  • POST /rtc - Creates a WebRTC transcription session
  • POST /observer/:callId - WebSocket observer for transcription events

Environment Variables

Set in your Val Town environment:

  • OPENAI_API_KEY - Your OpenAI API key (required)

Local Development

# Install Deno curl -fsSL https://deno.land/install.sh | sh # Run locally deno run --allow-all main.tsx

Val Town Deployment

  1. Fork/remix this val on Val Town
  2. Add your OPENAI_API_KEY to Val Town secrets
  3. Your app will be available at https://[your-val-name].val.run