O Fun-ASR Realtime é o modelo de reconhecimento de fala em streaming da Alibaba: o áudio é transmitido por uma conexão persistente e o texto é retornado em streaming com baixa latência, sem limite de duração do stream.
A transcrição em streaming é cobrada pelo tempo de conexão, incluindo silêncio; feche a conexão ao terminar. O catálogo não publica a tarifa real de conexão.
Preços por comprimento de entrada
Toda a solicitação usa a tarifa da faixa de comprimento de entrada. Preços em USD por milhão de tokens.
| Tokens de entrada | Entrada | Saída | Entrada (modo raciocínio) |
|---|
Especificações e limites
Áudio
| Idiomas | Multilíngue com dialetos: 30 idiomas: chinês (mandarim, cantonês, wu, hokkien, hakka, gan, xiang, jin e sotaques regionais), inglês, japonês, coreano, vietnamita, tailandês, indonésio, malaio, filipino, híndi, árabe, francês, alemão, espanhol, português, russo, italiano, holandês, sueco, dinamarquês, finlandês, norueguês, grego, polonês, tcheco, húngaro, romeno, búlgaro, croata, eslovaco |
|---|---|
| Limites de áudio |
|
| Diarização de locutor | Não |
| Transcrição em streaming | Sim |
| Timestamps | Sim |
Modelo
| Modalidades | áudio → texto |
|---|
A documentação também descreve reconhecimento de emoções em 7 estados no guia de tempo real.
conforme fonte das especificações do modelo ↗
Use o Fun-ASR Realtime em 30 segundos
Envie quadros de áudio PCM binário por WebSocket e receba eventos de transcrição partial/final. WS /v1/audio/transcriptions/stream
# pip install websockets
# Prepare mono 16-bit little-endian PCM at 16 kHz:
# ffmpeg -i meeting.wav -f s16le -ac 1 -ar 16000 audio.pcm
import asyncio, contextlib, json, os
import websockets
MODEL = "fun-asr-realtime"
URL = "wss://synthorai.io/v1/audio/transcriptions/stream?model=" + MODEL + "&format=pcm&sample_rate=16000&bits=16&channels=1"
async def receive(ws):
async for raw in ws:
event = json.loads(raw)
if event["type"] in ("partial", "final"):
print(event["type"], event.get("text", ""))
elif event["type"] == "error":
raise RuntimeError(event.get("error", "ASR failed"))
elif event["type"] == "done":
return
async def main():
async with websockets.connect(URL, additional_headers={
"Authorization": "Bearer " + os.environ["SYNTHORAI_API_KEY"],
}, open_timeout=15, close_timeout=5) as ws:
reader = asyncio.create_task(receive(ws))
try:
with open("audio.pcm", "rb") as audio:
while frame := audio.read(3200): # 100 ms, sent at real-time speed
if reader.done():
await reader
return
await ws.send(frame) # binary PCM, not JSON/base64
await asyncio.sleep(len(frame) / 32000)
# No text finish message is supported. Allow a bounded receive window,
# then close normally; a trailing final transcript is not guaranteed.
await asyncio.sleep(1)
await ws.close(code=1000)
await reader
finally:
reader.cancel()
with contextlib.suppress(asyncio.CancelledError):
await reader
asyncio.run(main())// npm install ws; prepare 16 kHz mono PCM16 in audio.pcm.
import WebSocket from "ws";
import { open } from "node:fs/promises";
import { setTimeout as delay } from "node:timers/promises";
const model = "fun-asr-realtime";
const ws = new WebSocket("wss://synthorai.io/v1/audio/transcriptions/stream?model=" + model + "&format=pcm&sample_rate=16000&bits=16&channels=1", {
headers: { Authorization: `Bearer ${process.env.SYNTHORAI_API_KEY}` },
handshakeTimeout: 15_000,
});
ws.on("message", raw => {
const event = JSON.parse(raw.toString());
if (event.type === "partial" || event.type === "final") console.log(event.type, event.text);
if (event.type === "error") { console.error(event.error); ws.close(1000); }
if (event.type === "done") ws.close(1000);
});
ws.on("error", error => console.error(error));
ws.on("open", async () => {
const audio = await open("audio.pcm", "r");
try {
const frame = Buffer.alloc(3200); // 100 ms of mono PCM16 at 16 kHz
while (ws.readyState === WebSocket.OPEN) {
const { bytesRead } = await audio.read(frame, 0, frame.length, null);
if (!bytesRead) break;
await new Promise<void>((resolve, reject) => ws.send(frame.subarray(0, bytesRead),
{ binary: true }, error => error ? reject(error) : resolve()));
await delay(bytesRead / 32);
}
// Text finish messages are ignored. Bounded receive window, then normal close;
// the protocol does not guarantee the trailing final transcript after close.
await delay(1000);
ws.close(1000);
} catch (error) {
console.error(error);
ws.close(1000);
} finally {
await audio.close();
}
});# cURL cannot send this binary-PCM WebSocket conversation.
# Run this shell example with Python and the websockets package instead.
python3 - <<'PY'
# pip install websockets
# Prepare mono 16-bit little-endian PCM at 16 kHz:
# ffmpeg -i meeting.wav -f s16le -ac 1 -ar 16000 audio.pcm
import asyncio, contextlib, json, os
import websockets
MODEL = "fun-asr-realtime"
URL = "wss://synthorai.io/v1/audio/transcriptions/stream?model=" + MODEL + "&format=pcm&sample_rate=16000&bits=16&channels=1"
async def receive(ws):
async for raw in ws:
event = json.loads(raw)
if event["type"] in ("partial", "final"):
print(event["type"], event.get("text", ""))
elif event["type"] == "error":
raise RuntimeError(event.get("error", "ASR failed"))
elif event["type"] == "done":
return
async def main():
async with websockets.connect(URL, additional_headers={
"Authorization": "Bearer " + os.environ["SYNTHORAI_API_KEY"],
}, open_timeout=15, close_timeout=5) as ws:
reader = asyncio.create_task(receive(ws))
try:
with open("audio.pcm", "rb") as audio:
while frame := audio.read(3200): # 100 ms, sent at real-time speed
if reader.done():
await reader
return
await ws.send(frame) # binary PCM, not JSON/base64
await asyncio.sleep(len(frame) / 32000)
# No text finish message is supported. Allow a bounded receive window,
# then close normally; a trailing final transcript is not guaranteed.
await asyncio.sleep(1)
await ws.close(code=1000)
await reader
finally:
reader.cancel()
with contextlib.suppress(asyncio.CancelledError):
await reader
asyncio.run(main())
PYpackage main
// go get github.com/gorilla/websocket
// Prepare 16 kHz mono PCM16 in audio.pcm before running.
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
"github.com/gorilla/websocket"
)
func main() {
model := "fun-asr-realtime"
headers := http.Header{}
headers.Set("Authorization", "Bearer " + os.Getenv("SYNTHORAI_API_KEY"))
dialer := websocket.Dialer{HandshakeTimeout: 15 * time.Second}
ws, _, err := dialer.Dial("wss://synthorai.io/v1/audio/transcriptions/stream?model=" + model + "&format=pcm&sample_rate=16000&bits=16&channels=1", headers)
if err != nil { panic(err) }
defer ws.Close()
done := make(chan struct{})
go func() {
defer close(done)
for {
_, raw, err := ws.ReadMessage()
if err != nil { return }
var event struct { Type string; Text string; Error string }
if err := json.Unmarshal(raw, &event); err != nil { return }
switch event.Type {
case "partial", "final": fmt.Println(event.Type, event.Text)
case "error": fmt.Println(event.Error); return
case "done": return
}
}
}()
audio, err := os.Open("audio.pcm")
if err != nil { panic(err) }
defer audio.Close()
frame := make([]byte, 3200)
for {
select { case <-done: return; default: }
n, err := audio.Read(frame)
if err != nil && err != io.EOF { panic(err) }
if n == 0 { break }
ws.SetWriteDeadline(time.Now().Add(10 * time.Second))
if err := ws.WriteMessage(websocket.BinaryMessage, frame[:n]); err != nil { panic(err) }
time.Sleep(time.Duration(n) * time.Second / 32000)
}
// No text finish message: bounded receive window, then close normally.
// A trailing final transcript after close is not guaranteed.
select { case <-done: return; case <-time.After(time.Second): }
ws.WriteControl(websocket.CloseMessage, websocket.FormatCloseMessage(1000, ""), time.Now().Add(time.Second))
select { case <-done: case <-time.After(2 * time.Second): }
}import java.net.URI;
import java.net.http.*;
import java.nio.ByteBuffer;
import java.nio.file.*;
import java.util.concurrent.*;
// Prepare 16 kHz mono PCM16 in audio.pcm before running.
class StreamingAsrExample {
public static void main(String[] args) throws Exception {
String model = "fun-asr-realtime";
var closed = new CompletableFuture<Void>();
var listener = new WebSocket.Listener() {
private final StringBuilder message = new StringBuilder();
public void onOpen(WebSocket ws) { ws.request(1); }
public CompletionStage<?> onText(WebSocket ws, CharSequence data, boolean last) {
message.append(data);
if (last) {
// Normalized JSON event types: partial, final, error, done; transcript is text.
System.out.println(message);
message.setLength(0);
}
ws.request(1);
return null;
}
public CompletionStage<?> onClose(WebSocket ws, int status, String reason) {
closed.complete(null); return null;
}
public void onError(WebSocket ws, Throwable error) { closed.completeExceptionally(error); }
};
var ws = HttpClient.newHttpClient().newWebSocketBuilder()
.connectTimeout(java.time.Duration.ofSeconds(15))
.header("Authorization", "Bearer " + System.getenv("SYNTHORAI_API_KEY"))
.buildAsync(URI.create("wss://synthorai.io/v1/audio/transcriptions/stream?model=" + model + "&format=pcm&sample_rate=16000&bits=16&channels=1"), listener).join();
try (var audio = Files.newInputStream(Path.of("audio.pcm"))) {
byte[] frame = new byte[3200];
int size;
while (!closed.isDone() && (size = audio.read(frame)) != -1) {
ws.sendBinary(ByteBuffer.wrap(java.util.Arrays.copyOf(frame, size)), true).join();
Thread.sleep(Math.max(1, size / 32));
}
// Text finish messages are ignored. Bounded receive window, then close;
// a trailing final transcript after close is not guaranteed.
Thread.sleep(1000);
ws.sendClose(1000, "").join();
closed.get(2, TimeUnit.SECONDS);
} finally { ws.abort(); }
}
}Sobre o Fun-ASR Realtime
- A documentação oficial o posiciona para legendas ao vivo, assistentes de voz e transcrição de reuniões, e ele carrega as forças da família Fun-ASR de personalização de hotwords mais cobertura multilíngue incluindo dialetos regionais chineses, inglês, japonês e coreano.
- A superfície de tempo real acrescenta controles de que os modelos baseados em arquivo não precisam: pontuação semântica, predição de pontuação ativada por padrão, um silêncio máximo de sentença ajustável que decide quando um enunciado é encerrado, um limiar de fala e ruído para ajuste contra som de fundo, e timestamps por palavra emitidos enquanto o stream corre.
- O áudio chega como PCM, WAV, MP3, Opus, Speex, AAC ou AMR a 8 ou 16 kHz.
- Dois limites merecem ser considerados no design: a diarização de locutores não está disponível no caminho de tempo real (para saber quem disse o quê são necessários os modelos por arquivo de gravação), e a cobertura de idiomas varia bastante conforme o snapshot datado em vez de ser uniforme na família, então fixe o snapshot de que o seu conjunto de idiomas depende.
- A rotulagem de emoção, o diferencial da linha Qwen3-ASR, também não é oferecida aqui, e o ajuste de precisão baseado em contexto está disponível apenas em alguns snapshots.
- A Synthorai o torna chamável pela mesma interface compatível com OpenAI usada pelo resto do seu catálogo de áudio.
Perguntas frequentes
A API do Fun-ASR Realtime é gratuita para testar?
Sim. Contas novas recebem 10 chamadas de teste e até $1 em créditos gratuitos, sem precisar de cartão. É o suficiente para testar o Fun-ASR Realtime com sua carga de trabalho real antes de adicionar um meio de pagamento.
Em que o Fun-ASR Realtime é melhor?
Transcrição em streaming sem limite de duração; criado para legendas ao vivo e reuniões; personalização de hotwords com cobertura multilíngue. Veja na seção Sobre o quadro completo, tirado das notas de lançamento do próprio provedor.
Quanto custa o Fun-ASR Realtime?
A transcrição em streaming é cobrada pelo tempo de conexão, incluindo silêncio; feche a conexão ao terminar. O catálogo não publica a tarifa real de conexão.
Quais idiomas o Fun-ASR Realtime suporta?
O Fun-ASR Realtime suporta Multilíngue com dialetos: 30 idiomas: chinês (mandarim, cantonês, wu, hokkien, hakka, gan, xiang, jin e sotaques regionais), inglês, japonês, coreano, vietnamita, tailandês, indonésio, malaio, filipino, híndi, árabe, francês, alemão, espanhol, português, russo, italiano, holandês, sueco, dinamarquês, finlandês, norueguês, grego, polonês, tcheco, húngaro, romeno, búlgaro, croata, eslovaco. Na Synthorai, você o chama via POST /v1/audio/transcriptions, no mesmo formato da API de transcrição da OpenAI.
Como obtenho acesso ao Fun-ASR Realtime?
Chame Fun-ASR Realtime por /v1/audio/transcriptions/stream com uma chave de API Synthorai. Siga o exemplo de integração desta página.
Modelos relacionados
Comparar
As especificações e os benchmarks dos fornecedores incluem links para as fontes. O suporte do gateway descreve a implementação da Synthorai. Os exemplos arquivados são solicitações individuais e não garantem o desempenho geral do modelo. Os preços vêm da API pública ou do snapshot usado na compilação.