Introduction
Sofya Transcription is a JavaScript library that provides a robust and flexible solution for real-time audio transcription. It is designed to transcribe audio streams and can be easily integrated into web applications. The library also includes functionality for capturing audio from media elements.
Requirements
Browser Requirements
To use Sofya Transcription in a web application, ensure your target environment meets these requirements:
- Modern Web Browser: Chrome, Safari, or Edge with WebSocket support
- Web Audio API: Required for audio processing and streaming
- MediaStream API: Required for microphone access and audio capture
- Microphone Access: Users must grant permission to access their microphone
- WebSocket Support: Required for real-time communication with the transcription service
Currently, Firefox has a known issue with audio sample rate compatibility when using the Web Audio API. This may result in the following error:
Error: DOMException: AudioContext.createMediaStreamSource: Connecting AudioNodes from AudioContexts with different sample-rate is currently not supported.
We are actively working on a solution for this issue and will address it in a future release. For now, we recommend using Chrome, Safari, or Edge for the best experience.
Development Requirements
For development and testing purposes, you'll need:
- Node.js: Version 18.x or higher
Features
Real-Time Transcription
Sofya Transcription provides fast and accurate real-time transcription of audio streams, ensuring that important information is captured efficiently and with high precision.
Flexible Integration
Designed for seamless integration, Sofya Transcription offers a flexible and modular approach that easily adapts to various workflows. It can be implemented without disrupting existing processes, allowing for a smooth experience when adding transcription functionality to your web applications.
Multiple Connection Modes
The SDK supports different connection modes to accommodate various deployment scenarios:
- API Key-based authentication
- Direct provider connections (Sofya Compliance and Sofya as Service)
- Customizable configuration options for each connection type
Media Element Audio Capture
Capture and transcribe audio from media elements such as <video>
and <audio>
with ease. This functionality allows for efficient transcription of pre-recorded content, making it easier to document and review audio data from multimedia sources, enhancing accessibility and usability.
Comprehensive Event System
The SDK provides a rich event system that allows you to:
- Monitor transcription progress in real-time
- Handle errors gracefully
- Respond to connection state changes
- Manage transcription lifecycle events
Type-Safe Development
Built with TypeScript, the SDK provides:
- Full type definitions for all components
- IntelliSense support in modern IDEs
- Compile-time error checking
- Better development experience
Getting Started
To start using Sofya Transcription in your project:
-
Install the package:
npm install sofya.transcription
-
Import the necessary components:
import { SofyaTranscriber } from 'sofya.transcription'
-
Create a transcriber instance and start transcribing:
const transcriber = new SofyaTranscriber({
apiKey: 'YOUR_API_KEY',
config: {
language: 'en-US'
}
})
For detailed information about the API and its features, please refer to the API documentation.