此语言仍有 25 条内容或界面任务待翻译;未完成部分显示中文原文。
AI Tools Navigation / Audio & Music / 实时语音转写(标准版)
音频与音乐 · 科大讯飞(讯飞开放平台)

实时语音转写(标准版)

Transcribe continuous audio streams into text in real time via a WebSocket interface, with translation and speaker separation support

AI 辅助整理
Real-time speech recognitionspeech-to-textreal-time captionsWebSocket APIreal-time translation

Tool Introduction

Real-Time Speech Transcription (Standard Edition) is a real-time speech recognition Web API provided by the iFLYTEK Open Platform. Developers establish a persistent connection via WebSocket and upload a mono PCM audio stream at a 16K sample rate and 16bit bit depth; the server returns JSON-formatted text results in real time, with no theoretical limit on audio stream length. The official typical use case listed is live captions for conferences or livestreams. The API also offers optional capabilities such as real-time translation, speaker separation, vertical-domain personalization parameters, and IP whitelisting. The API is intended only for developers with programming experience and does not support offline use; individual users may consider non-programming solutions such as iFLYTEK Tingjian.

Integration: The request protocol is ws[s], with the endpoint rtasr.xfyun.cn/v1/ws. Authentication requires appid, a timestamp ts, and a signature signa based on HmacSHA1(MD5(appid + ts), api_key). Character encoding is UTF-8, and responses are unified JSON.

Audio requirements: Sample rate 16k, bit depth 16bit, mono channel, in PCM format. It is recommended to send 1280 bytes of the audio stream every 40ms; sending too fast may cause engine errors. The audio sending interval timeout is 15 seconds; on timeout, the server reports an error and actively closes the connection.

Languages and extension parameters: lang defaults to Chinese; en can be passed for English; minority languages and dialects must be added in the console. engLangType controls the Chinese/English recognition mode; pd supports vertical-domain personalization for court, education, finance, healthcare, and other fields; roleType=2 enables speaker separation. After enabling translation, transType, transStrategy, and targetLang can be passed to translate while transcribing; target languages include English, Japanese, Korean, Russian, French, Spanish, Vietnamese, Cantonese, German, Italian, Arabic, and more.

Result structure: Returns a JSON with action/result. The data contains bg/ed (sentence start/end in milliseconds), w (words), wp (word/smoothed/punctuation markers), wb/we (frame-level timing, 1 frames=10ms), type (0 final result / 1 intermediate result), and seg_id. With translation enabled, the src and dst texts and an isEnd flag are returned.

Limits and error handling: Offline use is not supported; exceeding the authorized connection count returns 10800; 10105/10110 usually indicate signature, whitelist, or authorization/licensing issues. The sid field is used for DEBUG troubleshooting. Official demos are available for Go, Python2/3, Java, Node.js, and JS, along with Python/Java/PHP SDKs (GitHub iFLYTEK-OP repository), with a note that the demos are not suitable for direct use in production environments.

Who It's For

Developers with programming experience; the official FAQ explicitly states that this API targets developer users with a programming background, while individual users who do not want to code can use iFLYTEK Tingjian directly. Suitable for integrators needing real-time captions for meetings and livestreams, real-time transcription of calls/audio streams, and multilingual translated subtitles.

Recommended Steps

  1. 01

    Create an application on the iFLYTEK Open Platform and add the Real-Time Speech Transcription service to obtain the appid and apiKey (configure an IP whitelist if needed).

  2. 02

    Generate the signature signa using the formula HmacSHA1(MD5(appid + ts), api_key).

  3. 03

    Establish a WebSocket connection via wss://rtasr.xfyun.cn/v1/ws?appid=...&ts=...&signa=... with optional parameters (lang, pd, roleType, etc.) to complete the handshake.

  4. 04

    Upload the 16k/16bit mono PCM audio stream continuously as binary messages at a pace of about 1280 bytes every 40ms.

  5. 05

    Receive the JSON transcription results returned by the server and parse the data field; if translation is enabled, handle src/dst and isEnd.

  6. 06

    After the audio is fully sent, send a binary message with the content {"end" : true} to end the session.

  7. 07

    When an error code appears, check authorization parameters, the whitelist, connection count, or remaining duration per the documentation, and retry.

Know Before You Use

Requires an iFLYTEK Open Platform account and an application authorization with this service enabled. Only a Web API is provided; offline use is not supported. Server IPs are not fixed, so calls must use the domain name and cannot specify an IP. If the IP whitelist is enabled, it must be set to a public IP and takes effect about five minutes after saving. If the audio sending interval exceeds 15 seconds, the server will close the connection. Minority languages and dialects must be added for trial or purchased in the console; the translation feature must be enabled in the console. Exceeding the remaining duration during a connection does not interrupt it immediately, but the duration may go negative after disconnection—monitor remaining duration and purchase promptly.

费用与套餐:According to the official FAQ, free usage rights can be claimed directly on the product page; upon expiration, purchase duration and authorizations in the console (prices are visible). Purchasing is done by logging into the iFLYTEK Open Platform, going to the Real-Time Speech Transcription page, and clicking "Apply for Purchase" to buy duration online. Actual prices and package quotas are subject to what is currently displayed in the official console.

Product Selection Assistant

让需求变成可修改的筛选条件

依据已录入参数生成条件,结果可查看和修改。帧率与性能需核对实测,不能仅凭算力数值保证。