mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
update websocket_protocol
This commit is contained in:
parent
eca477faf1
commit
f6daebd88e
@ -36,7 +36,7 @@ After sending the audio data, an end-of-audio flag needs to be sent (which needs
|
|||||||
#### Sending Recognition Results
|
#### Sending Recognition Results
|
||||||
The message (serialized in JSON) is:
|
The message (serialized in JSON) is:
|
||||||
```text
|
```text
|
||||||
{"mode": "offline", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True, "timestamp":"[[100,200], [200,500]]", "stamp_sents":""}
|
{"mode": "offline", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True, "timestamp":"[[100,200], [200,500]]", "stamp_sents":[]}
|
||||||
```
|
```
|
||||||
Parameter explanation:
|
Parameter explanation:
|
||||||
```text
|
```text
|
||||||
@ -45,7 +45,7 @@ Parameter explanation:
|
|||||||
`text`: the text output of speech recognition
|
`text`: the text output of speech recognition
|
||||||
`is_final`: indicating the end of recognition
|
`is_final`: indicating the end of recognition
|
||||||
`timestamp`:If AM is a timestamp model, it will return this field, indicating the timestamp, in the format of "[[100,200], [200,500]]"
|
`timestamp`:If AM is a timestamp model, it will return this field, indicating the timestamp, in the format of "[[100,200], [200,500]]"
|
||||||
`stamp_sents`:If AM is a timestamp model, it will return this field, indicating the stamp_sents, in the format of "[{'text_seg':'正 是 因 为','punc':',','start':'430','end':'1130','ts_list':[[430,670],[670,810],[810,1030],[1030,1130]]}]"
|
`stamp_sents`:If AM is a timestamp model, it will return this field, indicating the stamp_sents, in the format of [{"text_seg":"正 是 因 为","punc":",","start":"430","end":"1130","ts_list":[[430,670],[670,810],[810,1030],[1030,1130]]}]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Real-time Speech Recognition
|
## Real-time Speech Recognition
|
||||||
@ -85,7 +85,7 @@ After sending the audio data, an end-of-audio flag needs to be sent (which needs
|
|||||||
The message (serialized in JSON) is:
|
The message (serialized in JSON) is:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
{"mode": "2pass-online", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True, "timestamp":"[[100,200], [200,500]]", "stamp_sents":""}
|
{"mode": "2pass-online", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True, "timestamp":"[[100,200], [200,500]]", "stamp_sents":[]}
|
||||||
```
|
```
|
||||||
Parameter explanation:
|
Parameter explanation:
|
||||||
```text
|
```text
|
||||||
@ -94,5 +94,5 @@ Parameter explanation:
|
|||||||
`text`: the text output of speech recognition
|
`text`: the text output of speech recognition
|
||||||
`is_final`: indicating the end of recognition
|
`is_final`: indicating the end of recognition
|
||||||
`timestamp`:If AM is a timestamp model, it will return this field, indicating the timestamp, in the format of "[[100,200], [200,500]]"
|
`timestamp`:If AM is a timestamp model, it will return this field, indicating the timestamp, in the format of "[[100,200], [200,500]]"
|
||||||
`stamp_sents`:If AM is a timestamp model, it will return this field, indicating the stamp_sents, in the format of "[{'text_seg':'正 是 因 为','punc':',','start':'430','end':'1130','ts_list':[[430,670],[670,810],[810,1030],[1030,1130]]}]"
|
`stamp_sents`:If AM is a timestamp model, it will return this field, indicating the stamp_sents, in the format of [{"text_seg":"正 是 因 为","punc":",","start":"430","end":"1130","ts_list":[[430,670],[670,810],[810,1030],[1030,1130]]}]
|
||||||
```
|
```
|
||||||
|
|||||||
@ -37,7 +37,7 @@ pcm直接将音频数据,其他格式音频数据,连同头部信息与音
|
|||||||
#### 发送识别结果
|
#### 发送识别结果
|
||||||
message为(采用json序列化)
|
message为(采用json序列化)
|
||||||
```text
|
```text
|
||||||
{"mode": "offline", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True,"timestamp":"[[100,200], [200,500]]","stamp_sents":""}
|
{"mode": "offline", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True,"timestamp":"[[100,200], [200,500]]","stamp_sents":[]}
|
||||||
```
|
```
|
||||||
参数介绍:
|
参数介绍:
|
||||||
```text
|
```text
|
||||||
@ -46,7 +46,7 @@ message为(采用json序列化)
|
|||||||
`text`:表示语音识别输出文本
|
`text`:表示语音识别输出文本
|
||||||
`is_final`:表示识别结束
|
`is_final`:表示识别结束
|
||||||
`timestamp`:如果AM为时间戳模型,会返回此字段,表示时间戳,格式为 "[[100,200], [200,500]]"(ms)
|
`timestamp`:如果AM为时间戳模型,会返回此字段,表示时间戳,格式为 "[[100,200], [200,500]]"(ms)
|
||||||
`stamp_sents`:如果AM为时间戳模型,会返回此字段,表示句子级别时间戳,格式为 "[{'text_seg':'正 是 因 为','punc':',','start':'430','end':'1130','ts_list':[[430,670],[670,810],[810,1030],[1030,1130]]}]"
|
`stamp_sents`:如果AM为时间戳模型,会返回此字段,表示句子级别时间戳,格式为 [{"text_seg":"正 是 因 为","punc":",","start":"430","end":"1130","ts_list":[[430,670],[670,810],[810,1030],[1030,1130]]}]
|
||||||
```
|
```
|
||||||
|
|
||||||
## 实时语音识别
|
## 实时语音识别
|
||||||
@ -87,7 +87,7 @@ message为(需要用json序列化):
|
|||||||
#### 发送识别结果
|
#### 发送识别结果
|
||||||
message为(采用json序列化)
|
message为(采用json序列化)
|
||||||
```text
|
```text
|
||||||
{"mode": "2pass-online", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True, "timestamp":"[[100,200], [200,500]]","stamp_sents":""}
|
{"mode": "2pass-online", "wav_name": "wav_name", "text": "asr ouputs", "is_final": True, "timestamp":"[[100,200], [200,500]]","stamp_sents":[]}
|
||||||
```
|
```
|
||||||
参数介绍:
|
参数介绍:
|
||||||
```text
|
```text
|
||||||
@ -96,5 +96,5 @@ message为(采用json序列化)
|
|||||||
`text`:表示语音识别输出文本
|
`text`:表示语音识别输出文本
|
||||||
`is_final`:表示识别结束
|
`is_final`:表示识别结束
|
||||||
`timestamp`:如果AM为时间戳模型,会返回此字段,表示时间戳,格式为 "[[100,200], [200,500]]"(ms)
|
`timestamp`:如果AM为时间戳模型,会返回此字段,表示时间戳,格式为 "[[100,200], [200,500]]"(ms)
|
||||||
`stamp_sents`:如果AM为时间戳模型,会返回此字段,表示句子级别时间戳,格式为 "[{'text_seg':'正 是 因 为','punc':',','start':'430','end':'1130','ts_list':[[430,670],[670,810],[810,1030],[1030,1130]]}]"
|
`stamp_sents`:如果AM为时间戳模型,会返回此字段,表示句子级别时间戳,格式为 [{"text_seg":"正 是 因 为","punc":",","start":"430","end":"1130","ts_list":[[430,670],[670,810],[810,1030],[1030,1130]]}]
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user