Welcome
AudioTranscribe API Documentation
Overview
The AudioTranscribe API allows you to stream audio data via WebSocket and receive real-time voice transcriptions. This service is ideal for applications requiring live speech-to-text functionality.
WebSocket Endpoint
wss://api.audiotranscribe.com/v1/transcribe
Authentication
To use the AudioTranscribe API, you need to include your API key in the WebSocket connection request headers:
Authorization: Bearer YOUR_API_KEY
Streaming Protocol
- Establish a WebSocket connection to the endpoint.
- Send audio data in binary format.
- Receive transcription results as they become available.
Audio Format
- Supported audio format: 16-bit PCM
- Sample rate: 16000 Hz
- Channels: Mono
Message Format
Client to Server
Send raw audio data as binary WebSocket messages.
Server to Client
Transcription results are sent as JSON objects:
{
"transcript": "This is the transcribed text.",
"confidence": 0.95,
"is_final": false
}
transcript
: The transcribed textconfidence
: Confidence score between 0 and 1is_final
: Boolean indicating if this is the final result for the current audio segment
Example Usage
Here's a simple example using JavaScript and the WebSocket API:
const socket = new WebSocket('wss://api.audiotranscribe.com/v1/transcribe');
socket.onopen = function(event) {
console.log('WebSocket connection established');
// Start sending audio data
};
socket.onmessage = function(event) {
const result = JSON.parse(event.data);
console.log('Transcription:', result.transcript);
};
// Function to send audio data (implement this based on your audio source)
function sendAudioData(audioChunk) {
if (socket.readyState === WebSocket.OPEN) {
socket.send(audioChunk);
}
}
Error Handling
The server may send error messages in the following format:
{
"error": "Error message description"
}
Common errors include authentication failures, invalid audio format, or service unavailability.
Rate Limiting
- Free tier: 10 minutes of audio per day
- Pro tier: 1000 minutes of audio per day
Exceeding these limits will result in a rate limit error message.
Support
For any issues or questions, please contact our support team at [email protected].