Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit c1748e2

Browse files
committed
fix: fix parsing audio type
1 parent d1c3bcc commit c1748e2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/ms_tts.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ pub(crate) async fn register_service() {
297297
}
298298
}
299299
Message::Binary(s) => {
300-
if s.starts_with(&TAG_SOME_DATA_START) {
300+
if s.starts_with(&TAG_NONE_DATA_START) {
301+
let id = String::from_utf8(s[14..46].to_vec()).unwrap();
302+
trace!("二进制响应体结束 TAG_NONE_DATA_START, {}",id);
303+
} else {
301304
let id = String::from_utf8(s[14..46].to_vec()).unwrap();
302305
let mut body = BytesMut::from(s.as_slice());
303306
let index = binary_search(&s, &TAG_BODY_SPLIT).unwrap();
@@ -316,12 +319,12 @@ pub(crate) async fn register_service() {
316319
drop(cache);
317320
// unsafe { Arc::get_mut_unchecked(&mut MS_TTS_DATA_CACHE.clone()).get_mut(&id).unwrap().lock().await.data.put(body) };
318321
trace!("二进制响应体 ,{}",id);
319-
} else if s.starts_with(&TAG_NONE_DATA_START) {
320-
let id = String::from_utf8(s[14..46].to_vec()).unwrap();
321-
trace!("二进制响应体结束 TAG_NONE_DATA_START, {}",id);
322-
} else {
322+
323+
324+
325+
}/* else {
323326
trace!("其他二进制类型: {} ", unsafe { String::from_utf8_unchecked(s.to_vec()) });
324-
}
327+
}*/
325328
}
326329
_ => {}
327330
}

0 commit comments

Comments
 (0)