Skip to content

This article introduces an online web real-time speech recognition tool that supports real-time microphone recording recognition and audio/video file speech recognition, and is available for free use (no usage restrictions).

https://stt.pyvideotrans.com

Speech recognition technology, also known as speech-to-text, utilizes artificial intelligence to convert speech in audio or video into text. This technology has a wide range of applications in various fields, such as meeting minutes, voice assistants, subtitle generation, and more.

Currently, there are two main approaches to speech recognition:

1. Offline Model-Based Speech Recognition:

This approach requires deploying a speech recognition model on a local computer. A popular open-source solution is OpenAI Whisper. After downloading its large model (e.g., large-v2), it can be used offline, without the need for an internet connection or payment.

However, this method requires significant computing resources (e.g., a powerful graphics card), otherwise the recognition speed will be slow, and the accuracy will decrease.

2. Online API-Based Speech Recognition:

Some companies offer online speech recognition API services, such as ByteDance and OpenAI.

Users only need to upload audio data to the API to obtain transcription results.

This method does not require local hardware resources, is fast and accurate, but requires payment of certain fees.

Real-time Speech Recognition

The above two methods are mainly for existing audio or video files. So, how can we perform real-time transcription of audio streams recorded in real-time by a microphone? For example, how to record speeches in a meeting in real-time and convert them into text?

Real-time speech recognition is similar in principle to file transcription but is more technically challenging. It requires:

  • Real-time Data Stream Processing: Continuously receiving audio data from the microphone.
  • Data Segmentation and Recognition: Dividing the continuous audio stream into smaller segments and recognizing them individually.
  • Result Integration and Error Correction: Integrating the recognition results of each segment and performing error correction to improve the accuracy of the final transcription. This usually requires more complex algorithms to handle speech pauses, overlaps, and other situations.
  • Minimal Latency: Minimizing the delay from audio input to text output as much as possible to ensure real-time performance.

Technical Principles and Usage Introduction

image.png

  • Real-time Microphone Recording Recognition: Use the microphone to record audio in real-time and transcribe it in real-time.
  • Audio/Video File Speech Recognition: Supports uploading local audio or video files for transcription.

Technical Principles:

  1. Lightweight Speech Recognition Model (Vosk): To run in a browser environment, we used the small-sized Vosk speech recognition model. Although its accuracy is relatively low, it can effectively reduce resource consumption and ensure smooth operation in the browser.

  2. Local Audio Processing (ffmpeg.wasm): Utilize ffmpeg.wasm to process audio and video files and extract speech within the user's browser, without uploading audio data to the server.

  3. Client-Side Model Loading: The speech recognition model is downloaded and run in the browser's memory. This limits us from using larger, more accurate models and forces us to choose smaller models to avoid browser crashes. Even if the user's computer has powerful performance, large models are currently not supported due to server bandwidth limitations.

How to Use

  1. Model Loading: Before use, please load the Chinese or English model as needed.
  2. Microphone Recognition: Click the button in the left area to start real-time recording and recognition using the microphone. The recognition results will be displayed in the text box in real-time.
  3. File Recognition: In the right area, select a local audio or video file. The tool will use ffmpeg.wasm for local processing and speech recognition. The results are displayed in the text box.
  4. Result Download: You can download the transcribed text as a TXT file.

Precautions

  1. Mutually Exclusive Functions: Microphone real-time recognition and file recognition functions cannot be used simultaneously.
  2. Local Processing: Model and audio processing are performed locally in the user's browser.
  3. Language Support: Currently, only Chinese and English speech recognition are supported.
  4. Performance Limitations: Due to the use of a lightweight model, the recognition accuracy may not be as good as that of large models.

Frequently Asked Questions

  • Q: What if the recognition accuracy is low? A: We used a lightweight model to ensure browser compatibility and running speed. If you need higher accuracy, we recommend downloading pyVideoTrans and using the large-v2 model locally.
  • Q: Which languages are supported? A: Currently, only Chinese and English are supported.
  • Q: Why is it slow? A: This may be due to network conditions, browser performance, or insufficient computer resources.
  • Q: How large a file can I upload? A: The file size is limited by browser memory and processing power.