parent
8b596ba355
commit
b76201db4c
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Speech Synthesis Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Speech Synthesis Example</h1>
|
||||
<input type="text" id="text" value="请0的家属到手术室门口接病人">
|
||||
<br>
|
||||
<button onclick="speakText()">Speak</button>
|
||||
|
||||
<script>
|
||||
const synth = window.speechSynthesis;
|
||||
|
||||
function speakText() {
|
||||
const textInput = document.getElementById('text').value;
|
||||
const utterance = new SpeechSynthesisUtterance(textInput);
|
||||
|
||||
// 固定播放速度和语音
|
||||
utterance.rate = 1.0; // 播放速度
|
||||
const voices = synth.getVoices();
|
||||
const selectedVoice = voices.find(voice => voice.lang === 'zh-CN'); // 固定选择中文(普通话)的语音
|
||||
|
||||
if (selectedVoice) {
|
||||
utterance.voice = selectedVoice;
|
||||
}
|
||||
|
||||
// 添加 onend 事件处理器
|
||||
utterance.onend = function(event) {
|
||||
console.log('Speech has finished.');
|
||||
alert('Speech has finished.');
|
||||
};
|
||||
|
||||
window.speechSynthesis.speak(utterance);
|
||||
}
|
||||
|
||||
// 等待语音列表加载完成
|
||||
function checkVoices() {
|
||||
if (synth.getVoices().length !== 0) {
|
||||
clearInterval(voicesCheckInterval);
|
||||
}
|
||||
}
|
||||
|
||||
const voicesCheckInterval = setInterval(checkVoices, 100);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,16 +1,27 @@
|
||||
import _axios from '@/utils/_axios';
|
||||
|
||||
/**
|
||||
* 麻醉管理患者列表
|
||||
* 患者等候大屏列表
|
||||
*/
|
||||
export const getAnesPatientList = data => {
|
||||
export const getAnesPatientList = date => {
|
||||
return _axios({
|
||||
method: 'post',
|
||||
url: '/api/ScheduleMicroservice/OperationRecord/AnesPatientList',
|
||||
url: '/api/DoctorMicroservice/AnesthesiaRecord/GetAnesthesiaRecordFamilyWaitingAsync',
|
||||
params: {
|
||||
pageIndex: 1,
|
||||
pageSize: 999,
|
||||
scheduledDatetime: date,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 手术排程大屏列表
|
||||
*/
|
||||
export const getOperationList = date => {
|
||||
return _axios({
|
||||
method: 'post',
|
||||
url: '/api/ScheduleMicroservice/OperationRecord/GetOperationRecordScreenAsync',
|
||||
params: {
|
||||
scheduledDatetime: date,
|
||||
},
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in new issue