Skip to main content
This guide provides a complete working example of how to use our REST API for audio transcription. The sample project demonstrates recording audio in the browser and sending it to our API for processing.

Sample Project

Below is a complete HTML file that demonstrates:
  • Browser-based audio recording
  • Audio format conversion (WebM to 16kHz WAV)
  • Base64 encoding
  • REST API integration
  • Response handling
You can save this as an HTML file and run it directly in your browser:

Key Features

This sample project demonstrates several important features:
  1. Audio Recording:
    • Browser-based audio recording using the MediaRecorder API
    • Automatic conversion from WebM to WAV format
    • Resampling to 16kHz mono audio
  2. Audio Processing:
    • WAV file generation with proper headers
    • Base64 encoding for API transmission
  3. API Integration:
    • REST API authentication
    • JSON payload formatting
    • Response handling and display
  4. User Interface:
    • Simple recording controls
    • Audio playback
    • Status updates
    • Response display

Usage

  1. Replace <YOUR_API_KEY> with your actual API key
  2. Save the file with a .html extension
  3. Open in a modern web browser
  4. Click “Start Recording” to begin recording
  5. Click “Stop Recording” to stop and send to the API
  6. View the transcription response below the audio player
Make sure you’re using a modern browser that supports the MediaRecorder API and WebAudio API. The sample requires HTTPS or localhost for microphone access.