Fun-ASR Realtime は Alibaba のストリーミング音声認識モデルです。
ストリーミング文字起こしは無音を含む接続時間で課金されます。終了時に接続を閉じてください。 このカタログには実際の接続料金は掲載されていません。
入力長別の料金
リクエスト全体に入力長の区分の単価が適用されます。料金は100万トークンあたりの米ドルです。
| 入力トークン数 | 入力 | 出力 | 思考モード入力 |
|---|
仕様と制限
音声
| 言語 | 方言を含む多言語対応で 30 言語:中国語(標準中国語、広東語、呉語、閩南語、客家語、贛語、湘語、晋語および各地の訛り)、英語、日本語、韓国語、ベトナム語、タイ語、インドネシア語、マレー語、フィリピン語、ヒンディー語、アラビア語、フランス語、ドイツ語、スペイン語、ポルトガル語、ロシア語、イタリア語、オランダ語、スウェーデン語、デンマーク語、フィンランド語、ノルウェー語、ギリシャ語、ポーランド語、チェコ語、ハンガリー語、ルーマニア語、ブルガリア語、クロアチア語、スロバキア語 |
|---|---|
| 音声の制限 |
|
| 話者分離 | 非対応 |
| ストリーミング文字起こし | 対応 |
| タイムスタンプ | 対応 |
モデル
| モダリティ | 音声 → テキスト |
|---|
ドキュメントのリアルタイムガイドでは 7 状態の感情認識も説明されています。
出典:モデル仕様の出典 ↗
30 秒で Fun-ASR Realtime を使い始める
WebSocket でバイナリ PCM 音声フレームを送信し、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(); }
}
}Fun-ASR Realtime について
- 音声は持続的な接続経由でストリーム入力され、テキストが低レイテンシでストリーム返却され、ストリームの長さに上限はありません。
- 公式ドキュメントは、ライブ字幕、音声アシスタント、会議の文字起こし向けに位置づけており、ホットワードカスタマイズと、中国語の地方方言・英語・日本語・韓国語を含む多言語カバレッジという Fun-ASR ファミリーの強みを備えます。
- リアルタイムの面には、ファイルベースのモデルには不要な制御が加わります。
- セマンティック句読点、既定でオンの句読点予測、発話の区切りを決める調整可能な最大無音時間、背景音に対して調整するための音声ノイズしきい値、そしてストリームの進行に合わせて出力される単語レベルのタイムスタンプです。
- 音声は PCM、WAV、MP3、Opus、Speex、AAC、AMR を 8 kHz または 16 kHz で受け付けます。
- 設計時に織り込むべき制限が 2 つあります。
- 話者ダイアライゼーションはリアルタイム経路では利用できず(誰が何を話したかが必要なら録音ファイル向けのモデルが必要です)、言語カバレッジはファミリー全体で一様ではなく日付付きのスナップショットごとに大きく異なるため、必要な言語セットに対応するスナップショットをピン留めしてください。
- Qwen3-ASR ラインの差別化要素である感情ラベル付けもここでは提供されず、コンテキストに基づく精度調整は一部のスナップショットでのみ利用できます。
- Synthorai は、他の音声カタログと同じ OpenAI 互換インターフェース経由で呼び出せるようにします。
よくある質問
Fun-ASR Realtime API は無料で試せますか?
はい。新規アカウントには 10 回のお試し呼び出しと最大 $1 の無料クレジットが付き、カード登録は不要です。支払い方法を追加する前に、実際のワークロードで Fun-ASR Realtime を試すには十分な量です。
Fun-ASR Realtime は何が得意ですか?
長さ上限のないストリーミング文字起こし、ライブ字幕と会議向けに構築、多言語カバレッジを伴うホットワードカスタマイズ。詳しくは、ベンダー公式のリリースノートをもとにまとめた、このページのモデル紹介セクションをご覧ください。
Fun-ASR Realtime の料金はいくらですか?
ストリーミング文字起こしは無音を含む接続時間で課金されます。終了時に接続を閉じてください。 このカタログには実際の接続料金は掲載されていません。
Fun-ASR Realtime はどの言語に対応していますか?
Fun-ASR Realtime は 方言を含む多言語対応で 30 言語:中国語(標準中国語、広東語、呉語、閩南語、客家語、贛語、湘語、晋語および各地の訛り)、英語、日本語、韓国語、ベトナム語、タイ語、インドネシア語、マレー語、フィリピン語、ヒンディー語、アラビア語、フランス語、ドイツ語、スペイン語、ポルトガル語、ロシア語、イタリア語、オランダ語、スウェーデン語、デンマーク語、フィンランド語、ノルウェー語、ギリシャ語、ポーランド語、チェコ語、ハンガリー語、ルーマニア語、ブルガリア語、クロアチア語、スロバキア語 に対応しています。Synthorai では POST /v1/audio/transcriptions で呼び出せます。OpenAI 文字起こし API と同じ形式です。
Fun-ASR Realtime を利用するには?
Synthorai API キーと /v1/audio/transcriptions/stream で Fun-ASR Realtime を呼び出します。このページの実装例を参照してください。
関連モデル
比較
仕様とベンダーのベンチマークには出典を付記しています。ゲートウェイの対応状況は Synthorai の実装を示します。保存された例は個々のリクエストの結果であり、モデル全般の性能を保証するものではありません。料金は公開料金 API またはビルド時のスナップショットに基づきます。