From 50d6c96383a45b5e1c520468f6cd62551e1f49da Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期一, 21 八月 2023 15:58:58 +0800
Subject: [PATCH] Fix bug for mp4 in h5 (#882)

---
 funasr/runtime/html5/static/main.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/funasr/runtime/html5/static/main.js b/funasr/runtime/html5/static/main.js
index 7e5a49a..e828ae1 100644
--- a/funasr/runtime/html5/static/main.js
+++ b/funasr/runtime/html5/static/main.js
@@ -110,7 +110,7 @@
 }
 function start_file_send()
 {
-		sampleBuf=new Int16Array( file_data_array );
+		sampleBuf=new Uint8Array( file_data_array );
  
 		var chunk_size=960; // for asr chunk_size [5, 10, 5]
  
@@ -214,7 +214,7 @@
 	}
 	tmptext=tmptext.replace(/銆�/g, ","); // in case there are a lot of "銆�"
 	var words=tmptext.split(",");
-	var jsontime=JSON.parse(tmptime.replace(/\]\]\[\[/g, "],[")); // in case there are a lot segments by VAD
+	var jsontime=JSON.parse(tmptime); //JSON.parse(tmptime.replace(/\]\]\[\[/g, "],[")); // in case there are a lot segments by VAD
 	var char_index=0;
 	var text_withtime="";
 	for(var i=0;i<words.length;i++)

--
Gitblit v1.9.1