|
|
@ -17,7 +17,7 @@
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="form-group">
|
|
|
|
<p>input text</p>
|
|
|
|
<p>input text</p>
|
|
|
|
|
|
|
|
|
|
|
|
<textarea cols="2" rows="3" style="width:600px;height:50px;" class="form-control" id="message">test</textarea>
|
|
|
|
<textarea cols="2" rows="3" style="width:600px;height:50px;" class="form-control" id="message"></textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-default">Send</button>
|
|
|
|
<button type="submit" class="btn btn-default">Send</button>
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
@ -33,9 +33,9 @@
|
|
|
|
<div class="div_class_recordControl">
|
|
|
|
<div class="div_class_recordControl">
|
|
|
|
asr服务器地址(必填):
|
|
|
|
asr服务器地址(必填):
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<input id="wssip" type="text" onchange="addresschange()" style="width: 500px;" value="wss://127.0.0.1:10197/"/>
|
|
|
|
<input id="wssip" type="text" onchange="addresschange()" style="width: 500px;" value="wss://127.0.0.1:10095/"/>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<a id="wsslink" style="display: block;" href="#" onclick="window.open('https://127.0.0.1:10197/', '_blank')"><div id="info_wslink">点此处手工授权wss://127.0.0.1:10095/</div></a>
|
|
|
|
<a id="wsslink" style="display: none;" href="#" onclick="window.open('https://127.0.0.1:10095/', '_blank')"><div id="info_wslink">点此处手工授权wss://127.0.0.1:10095/</div></a>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<div style="border:2px solid #ccc;display: none;">
|
|
|
|
<div style="border:2px solid #ccc;display: none;">
|
|
|
@ -46,7 +46,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<div id="mic_mode_div" style="border:2px solid #ccc;display:none;">
|
|
|
|
<div id="mic_mode_div" style="border:2px solid #ccc;display:none;">
|
|
|
|
选择asr模型模式:<br/>
|
|
|
|
选择asr模型模式:<br/>
|
|
|
|
|
|
|
|
|
|
|
@ -62,17 +62,17 @@
|
|
|
|
<input type="file" id="upfile">
|
|
|
|
<input type="file" id="upfile">
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<div style="border:2px solid #ccc;display: none;">
|
|
|
|
<div style="border:2px solid #ccc;display: none;">
|
|
|
|
热词设置(一行一个关键字,空格隔开权重,如"阿里巴巴 20"):
|
|
|
|
热词设置(一行一个关键字,空格隔开权重,如"阿里巴巴 20"):
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<textarea rows="3" id="varHot" style=" width: 100%;height:100%" >阿里巴巴 20 hello world 40</textarea>
|
|
|
|
<textarea rows="1" id="varHot" style=" width: 100%;height:auto" >阿里巴巴 20 hello world 40</textarea>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
语音识别结果显示:
|
|
|
|
<div style="display: none;">语音识别结果显示:</div>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<textarea rows="10" id="varArea" readonly="true" style=" width: 100%;height:100%" ></textarea>
|
|
|
|
<textarea rows="10" id="varArea" readonly="true" style=" width: 100%;height:auto;display: none;" ></textarea>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
|
<div id="info_div">请点击开始</div>
|
|
|
|
<div id="info_div">请点击开始</div>
|
|
|
|
<div class="div_class_buttons">
|
|
|
|
<div class="div_class_buttons">
|
|
|
@ -82,7 +82,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<audio id="audio_record" type="audio/wav" controls style="margin-top: 12px; width: 100%;"></audio>
|
|
|
|
<audio id="audio_record" type="audio/wav" controls style="margin-top: 2px; width: 100%;display: none;"></audio>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
@ -92,37 +92,37 @@
|
|
|
|
</body>
|
|
|
|
</body>
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
|
|
|
|
|
|
|
|
// $(document).ready(function() {
|
|
|
|
$(document).ready(function() {
|
|
|
|
// var host = window.location.hostname
|
|
|
|
var host = window.location.hostname
|
|
|
|
// var ws = new WebSocket("ws://"+host+":8000/humanecho");
|
|
|
|
var ws = new WebSocket("ws://"+host+":8000/humanecho");
|
|
|
|
// //document.getElementsByTagName("video")[0].setAttribute("src", aa["video"]);
|
|
|
|
//document.getElementsByTagName("video")[0].setAttribute("src", aa["video"]);
|
|
|
|
// ws.onopen = function() {
|
|
|
|
ws.onopen = function() {
|
|
|
|
// console.log('Connected');
|
|
|
|
console.log('Connected');
|
|
|
|
// };
|
|
|
|
};
|
|
|
|
// ws.onmessage = function(e) {
|
|
|
|
ws.onmessage = function(e) {
|
|
|
|
// console.log('Received: ' + e.data);
|
|
|
|
console.log('Received: ' + e.data);
|
|
|
|
// data = e
|
|
|
|
data = e
|
|
|
|
// var vid = JSON.parse(data.data);
|
|
|
|
var vid = JSON.parse(data.data);
|
|
|
|
// console.log(typeof(vid),vid)
|
|
|
|
console.log(typeof(vid),vid)
|
|
|
|
// //document.getElementsByTagName("video")[0].setAttribute("src", vid["video"]);
|
|
|
|
//document.getElementsByTagName("video")[0].setAttribute("src", vid["video"]);
|
|
|
|
|
|
|
|
|
|
|
|
// };
|
|
|
|
};
|
|
|
|
// ws.onclose = function(e) {
|
|
|
|
ws.onclose = function(e) {
|
|
|
|
// console.log('Closed');
|
|
|
|
console.log('Closed');
|
|
|
|
// };
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// flvPlayer = mpegts.createPlayer({type: 'flv', url: "http://"+host+":8080/live/livestream.flv", isLive: true, enableStashBuffer: false});
|
|
|
|
flvPlayer = mpegts.createPlayer({type: 'flv', url: "http://"+host+":8080/live/livestream.flv", isLive: true, enableStashBuffer: false});
|
|
|
|
// flvPlayer.attachMediaElement(document.getElementById('video_player'));
|
|
|
|
flvPlayer.attachMediaElement(document.getElementById('video_player'));
|
|
|
|
// flvPlayer.load();
|
|
|
|
flvPlayer.load();
|
|
|
|
// flvPlayer.play();
|
|
|
|
flvPlayer.play();
|
|
|
|
|
|
|
|
|
|
|
|
// $('#echo-form').on('submit', function(e) {
|
|
|
|
$('#echo-form').on('submit', function(e) {
|
|
|
|
// e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
// var message = $('#message').val();
|
|
|
|
var message = $('#message').val();
|
|
|
|
// console.log('Sending: ' + message);
|
|
|
|
console.log('Sending: ' + message);
|
|
|
|
// ws.send(message);
|
|
|
|
ws.send(message);
|
|
|
|
// $('#message').val('');
|
|
|
|
$('#message').val('');
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
</html>
|
|
|
|
</html>
|