在全球化的浪潮中,语言不再是障碍,而是连接世界的桥梁。掌握一门流利的英语,意味着打开了通往世界的大门。但是,如何确保你的英语口语如同母语者一样自然流畅?这正是我们存在的意义。
我们的中英文口语发音评测服务,采用最先进的语音识别技术和人工智能算法,为你提供专业、精准的发音评估。无论你是英语初学者还是希望进一步提高发音的学习者,我们的系统都能为你量身定制反馈,帮助你快速提高。
- 个性化反馈:我们的系统能够精确识别你的发音问题,并提供针对性的改进建议。
- 实时评分:通过即时评分功能,你可以直观了解自己的进步和需要加强的地方。
- 互动学习:结合有趣的互动练习,让学习过程不再枯燥,效率更高。
- 进度追踪:记录你的学习历程,让你清晰地看到每一步的成长。
加入我们,让我们一起跨越语言的障碍,用流利的英语开启你的全球之旅。无论是职场竞争还是日常交流,优秀的口语能力都将是你最强有力的支持。现在就来体验,让我们帮你把每一个音节雕琢得更加完美!
<template>
<div class="Evaluate-container">
<!-- 评测题型列表 -->
<div>
<!--第一行-->
<el-row :gutter="10" style="border-bottom: 1px dashed grey">
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/12.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
中文字评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: dodgerblue;color: white">
普通话
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">小学群体</span>
<br>
<el-radio v-model="radio" label="cn_vip+read_syllable">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/12.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
中文词语评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: dodgerblue;color: white">
普通话
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">小学/初中</span>
<br>
<el-radio v-model="radio" label="cn_vip+read_word">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/12.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
中文句子评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: dodgerblue;color: white">
普通话
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">高中群体</span>
<br>
<el-radio v-model="radio" label="cn_vip+read_sentence">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/12.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
中文篇章评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: dodgerblue;color: white">
普通话
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">高中/大学</span>
<br>
<el-radio v-model="radio" label="cn_vip+read_chapter">使用</el-radio>
</div>
</el-card>
</el-col>
<!-- <el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/9.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
男生飞哲<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: dodgerblue;color: white">
普通话
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">成年男生</span>
<br>
<el-radio v-model="radio" label="x4_lingfeizhe_oral">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/8.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
女生小琪<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: dodgerblue;color: white">
普通话
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">成年女生</span>
<br>
<el-radio v-model="radio" label="x4_lingxiaoqi_oral">使用</el-radio>
</div>
</el-card>
</el-col>-->
</el-row>
<br>
<!--第二行-->
<el-row :gutter="10" style="border-bottom: 1px dashed grey">
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文单词评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">小学/初中</span>
<br>
<el-radio v-model="radio" label="en_vip+read_word">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文句子评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">初中/高中</span>
<br>
<el-radio v-model="radio" label="en_vip+read_sentence">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文篇章评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">高中/大学</span>
<br>
<el-radio v-model="radio" label="en_vip+read_chapter">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文选择评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">高中/大学</span>
<br>
<el-radio v-model="radio" label="en_vip+read_choice">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文复述评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">通用</span>
<br>
<el-radio v-model="radio" label="en_vip+retell">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文自由评测<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">通用</span>
<br>
<el-radio v-model="radio" label="en_vip+topic">使用</el-radio>
</div>
</el-card>
</el-col>
</el-row>
<br>
<!--第三行-->
<el-row :gutter="10" style="border-bottom: 1px dashed grey">
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文口头翻译<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">通用</span>
<br>
<el-radio v-model="radio" label="en_vip+oral_translation">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文情景反应<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">通用</span>
<br>
<el-radio v-model="radio" label="en_vip+simple_expression">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/13.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
英文看图说话<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
英文
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">通用</span>
<br>
<el-radio v-model="radio" label="en_vip+picture_talk">使用</el-radio>
</div>
</el-card>
</el-col>
<!-- <el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/5.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
男童宁宁<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
儿童场景
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">男童男声</span>
<br>
<el-radio v-model="radio" label="x4_ningning">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/5.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
男童楠楠<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
儿童场景
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">男童男声</span>
<br>
<el-radio v-model="radio" label="x4_nannan">使用</el-radio>
</div>
</el-card>
</el-col>
<el-col :span="4">
<el-card style="height: 102px;">
<img src="../css_assets/6.png" style="width: 15%">
<div style="display: inline-block;vertical-align: top;margin-left: 20px;width: 120px;">
女童璜璜<br>
<span
style="padding-left: 5px;padding-right: 5px; font-size: 12px;background-color: orangered;color: white">
儿童场景
</span>
<span style="margin-left: 10px;font-size: 12px;color: #409EFF;">女童女声</span>
<br>
<el-radio v-model="radio" label="x4_xiaofang">使用</el-radio>
</div>
</el-card>
</el-col>-->
</el-row>
</div>
<br>
<!-- 合成文本区域 -->
<div>
<el-input type="textarea" v-model="iseContent" rows="15"
style="font-family: 'Microsoft YaHei';font-size: medium;font-weight: bold"
:maxlength="200000" show-word-limit placeholder="请输入不超过2000个汉字的文本进行合成">
</el-input>
</div>
<br>
<el-button type="primary" size="medium" @click="recordEvaluate" style="margin-left:10px;">录音评测</el-button>
<el-button type="danger" size="medium" @click="stopScore">停止打分</el-button>
<!-- 按钮区域 -->
</div>
</template>
<script>
function toBase64(buffer) {
var binary = "";
var bytes = new Uint8Array(buffer);
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return window.btoa(binary);
};
// 初始化录音工具,注意目录
let recorder = new Recorder("../../recorder")
recorder.onStart = () => {
console.log("开始录音了")
}
recorder.onStop = () => {
console.log("结束录音了")
// 拿听写结果去请求大模型
}
let wsFlag = false;
let wsTask = {};
recorder.onFrameRecorded = ({isLastFrame, frameBuffer}) => {
// alert("执行了...")
// console.log(isLastFrame, frameBuffer)
if (!isLastFrame && wsFlag) { // 发送中间帧
const params = {
"business": {
"cmd": "auw",
"aus": 1,
"aue": "raw"
},
"data": {
"status": 1,
"data": toBase64(frameBuffer),
"data_type": 1,
"encoding": "raw"
}
}
// console.log("发送中间帧", params, wsFlag)
wsTask.send(JSON.stringify(params)) // 执行发送
} else {
if (wsFlag) {
const params = {
"business": {
"cmd": "auw",
"aus": 4,
"aue": "raw"
},
"data": {
"status": 2,
"data": ""
}
}
console.log("发送最后一帧", params, wsFlag)
wsTask.send(JSON.stringify(params)) // 执行发送
}
}
}
// 听写个性化配置结束!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
export default {
data() {
return {
URL: 'wss://ise-api.xfyun.cn/v2/open-ise', // 评测地址
radio: 'cn_vip+read_syllable', // 单选项
iseContent: "国",
iseResult: "",
user: localStorage.getItem("user") ? JSON.parse(localStorage.getItem("user")) : {},
utf8bom: "\uFEFF",
ent: "cn_vip", // 引擎
category: "read_syllable", // 题型
}
},
watch: { // 这个场景watch 就是监听各个评测题型对应的值变化
radio(newVal, oldVal) {
// 复制ent和category
let tempArray = newVal.split("+")
this.ent = tempArray[0]
this.category = tempArray[1]
console.log(this.ent + "+" + this.category)
switch (newVal) {
case "cn_vip+read_syllable":
this.iseContent = "国"
break
case "cn_vip+read_word":
this.iseContent = "中国"
break
case "cn_vip+read_sentence":
this.iseContent = "50年前,长沙镖子岭。四个土夫子正蹲在一个土丘上,所有人都不说话,直勾勾盯着地上的洛阳铲。"
break
case "cn_vip+read_chapter":
this.iseContent = "下不下去喃?要得要不得,一句话,莫七里八里的!\n" +
"老烟头不怒反笑,对边上的一个大胡子说:你屋里二伢子海式撩天的,直不定什么时候就给翻盖子了,你得多教育教育,咱这买卖,不是有只匣子炮就能喔荷西天。\n" +
"那大胡子瞪了那年轻人一眼:你崽子,怎么这么跟老太爷讲话,老太爷淘土的时候你她妈的还在你娘肚子里咧。"
break
case "en_vip+read_word":
this.iseContent = "[word]\n" +
"apple"
break
case "en_vip+read_sentence":
this.iseContent = "[content]\n" +
"Youth is not a time of life."
break
case "en_vip+read_chapter":
this.iseContent = "[content]\n" +
"Youth is not a time of life.it is a state of mind," +
"it is not a matter of rosy cheeks,red lips and supple knees.\n" +
"it is a matter of the will," +
"a quality of the imagination,a vigor of the emotions.\n" +
"it is the freshness of the deep springs of life."
break
case "en_vip+read_choice":
this.iseContent = "[choice]\n" +
"1. Snakes.\n" +
"2. Children.\n" +
"3. Cats.\n" +
"[keywords]\n" +
"cats\n" +
"[question]\n" +
"What did the woman dislike?"
break
case "en_vip+retell":
this.iseContent = "[topic]\n" +
"1. The Goose Thief\n" +
"1.1. Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised. Students were all fond of them. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner. Tom got angry, and said to himself, \"I won't let them be eaten!\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students, and they all ran to the pond. The head teacher asked for an explanation. Looking at the teacher with fear, Tom told the story and said, \"It is unfair to them. We all love them!\" The head teacher smiled and promised not to have them killed for the Christmas dinner.\n" +
"[keypoint]\n" +
"1. Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised.\n" +
"2. Students were all fond of them.\n" +
"3. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner.\n" +
"4. Tom got angry, and said to himself, \"I won't let them be eaten!\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school.\n" +
"5. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat.\n" +
"6. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students,\n" +
"7. They all ran to the pond.\n" +
"8. The head teacher asked for an explanation.\n" +
"9. Looking at the teacher with fear, Tom told the story and said, \"It is unfair to them. We all love them!\"\n" +
"10. The head teacher smiled and promised not to have them killed for the Christmas dinner."
break
case "en_vip+topic":
this.iseContent = "[topic]\n" +
"1. The Goose Thief\n" +
"1.1. Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised. Students were all fond of them. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner. Tom got angry, and said to himself, \"I won't let them be eaten!\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students, and they all ran to the pond. The head teacher asked for an explanation. Looking at the teacher with fear, Tom told the story and said, \"It is unfair to them. We all love them!\" The head teacher smiled and promised not to have them killed for the Christmas dinner.\n" +
"[keypoint]\n" +
"1. Tom went to primary school in the countryside. Near his classroom, there was a small pond where two geese were raised.\n" +
"2. Students were all fond of them.\n" +
"3. One day, when Tom passed the school kitchen, he heard the cooks talking about killing the geese for the teachers' Christmas dinner.\n" +
"4. Tom got angry, and said to himself, \"I won't let them be eaten!\" That night, Tom worked out a plan. He was going to hide them somewhere far away from the school.\n" +
"5. The next morning, Tom went to school in his father's big coat. During the break, he rushed to the pond. Without anyone around, he caught the geese and pushed them inside the coat.\n" +
"6. However, the geese were larger than he had thought, and they tried very hard to free themselves from the coat. The big noise caught the notice of the head teacher and the students,\n" +
"7. They all ran to the pond.\n" +
"8. The head teacher asked for an explanation.\n" +
"9. Looking at the teacher with fear, Tom told the story and said, \"It is unfair to them. We all love them!\"\n" +
"10. The head teacher smiled and promised not to have them killed for the Christmas dinner."
break
case "en_vip+oral_translation":
this.iseContent = "[topic]\n" +
"1. British People\n" +
"1.1. British people usually say \"hello\" or \"nice to meet you\" and shake your hand when they meet you for the first time. They behave politely in public. They think it's rude to push in before others. They always queue. They are very polite at home as well. When in Rome, do as the Romans do. When we are in a strange place, we should do as the local people do.\n" +
"1.2. For the first meeting, the English will usually say \"hello\" or \"nice to meet you\" and shake hands with you. In the public places, they behave themselves well; they think that jumping in the line is a rude behavior, so they always line up. They are often very polite at home. When we are in a strange place, do in Rome as Rome does. We should behave well as local people.\n" +
"1.3. When they meet for the first time, the British usually say \"hello\" or \"nice to meet you\", and shake hands with each other. In public, they behave themselves appropriately. They think it is impolite to jump the queue, and they always wait in line patiently for their turns. They are also very polite at home. As the saying goes, \"when in Rome, do as the Romans do\". When we are in a strange place, we should act as the locals do.\n" +
"1.4. When first meet, English are likely to say \"hello\" or \"nice to meet you\" and shake hands with you. They behave well in public. They usually line up because they think queue jumping is very impolite. And they are also very polite at home. There is an old saying \"Do in Rome as Rome does\". So when we are in a new place, we should behave ourselves as the locals do.\n" +
"1.5. When meeting for the first time, Englishmen usually say \"hello\" or \"nice to meet you\" with a handshake. They behave themselves well in public places. They regard jumping a queue as one of the rude behavior, so they always queue up. They are also very polite at home. When in Rome, do as the Romans do. When we are in a strange place, we should behavior just like the local people.\n" +
"1.6. For the first meeting, English people usually say \"Hello\" or \"Nice to meet you\" and shake hands with you. In the public place, they also act very decently. In their views, it is very impolite to cut in line. They have formed a habit to wait in a queue. At home, they are also very polite. When in a strange place, we should do in Rome as the Romans do. Moreover, it is also polite that we behave like the local people.\n" +
"1.7. In first meeting, the English often say \"hi\" or \"nice to meet you!\" and then shake hands with you. In public occasions, they behave mannerly. They think jumping a queue is impolite and they always line up. Also, they are polite at home. When in Rome do as the Romans do. When we are in a strange land, we should behave like the natives.\n" +
"[vocabulary]\n" +
"behavior /b ih 'hh ey v y ax/\n" +
"uncourteous /,ah n 'k er t ir s/"
break
case "en_vip+simple_expression":
this.iseContent = "[choice]\n" +
"1. What should I do with the topic?\n" +
"2. How can I deal with the topic?\n" +
"3. What can I do with the topic?\n" +
"4. What should I do with this subject?\n" +
"5. How can I deal with this subject?\n" +
"6. What can I do with this subject?\n" +
"7. What should I do with this title?\n" +
"8. How can I deal with this title?\n" +
"9. What can I do with this title?\n" +
"10. What should I manage this title?\n" +
"11. How can I manage this title?\n" +
"12. What can I manage this title?\n" +
"13. What should I manage this subject?\n" +
"14. How can I manage this subject?\n" +
"15. What should I manage this topic?\n" +
"16. How can I manage this topic?\n" +
"17. What can I manage this topic?\n" +
"18. How should I deal with this topic?\n" +
"19. How should I deal with this title?\n" +
"20. How should I deal with this subject?\n" +
"[keywords]\n" +
"what do topic | how deal topic | what do subject | how deal subject | what do title | how deal title | what manage title | how manage title | what manage subject | how manage subject | what manage topic | how manage topic\n" +
"[script]\n" +
"W: Congratulations, Tom! You gave a wonderful speech yesterday morning.\n" +
"M: Thank you Mary.\n" +
"W: I will give a speech next Wednesday in my English class, but I am not fully prepared yet. Can you give me some advice?\n" +
"M: Sure. What's your topic?\n" +
"W: Well, I am always concerned about environmental issues, so my topic is Environmental Protection.\n" +
"M: This is a good topic, but it is too big.\n" +
"[question]\n" +
"我该如何处理这个题目?\n" +
"[macanswer]\n" +
"You have to narrow down your topic. For example, you may talk about what college students can do to protect our environment. After that, you need to do some research to collect relevant information as much as possible. Then, you should organize your arguments well. Logical organization is very important."
break
case "en_vip+picture_talk":
this.iseContent = "[topic]\n" +
"1. Throw Litter\n" +
"1.1. Mary and her classmates went outing last weekend. Someone was flying kites, some people were having snacks. There were litters on the road. Mary picked up the waste bottles and paper the put them in the dustbin. The teacher praised Mary for her good deed.\n" +
"1.2. Last weekend, Mary went to the park with her classmates. They had a picnic in the park. Some people flew kites there. They had great fun there. Mary saw some rubbish on the road. She picked up the rubbish and threw it into the dustbin. The teacher praised Mary.\n" +
"1.3. Last Saturday, Mary's class went to the park. They brought some food and had a picnic on the grass. After that, they flew kites there. Suddenly, Mary found that there was some rubbish on the road. She then picked up the rubbish and threw it into the dustbin. Mary's teacher saw this. She said \"Well done\" to Mary. Mary was very happy.\n" +
"1.4. Mary went to the park with her friend last weekend. They had a picnic there, while some people were flying kites. Mary's friend wanted to fly a kite too. So she threw waste bottles and paper on the ground and ran away. Mary saw this and picked up the rubbish. Then she threw it into the garbage can. A woman noticed what Mary had done. She praised Mary for her good behavior.\n" +
"1.5. Mary went to the park to have a picnic with her friend last Sunday. They brought some juice and bread as lunch. After lunch, they joined other people to fly kites. Mary saw some waste bottles and paper on the ground. Someone threw them away after having a picnic. Mary cleaned the road, putting the garbage into a garbage can. A lady saw this and praised Mary for what she had done.\n" +
"1.6. Last weekend, Mary and her classmates went to the park. Some of them flew kites, and some of them had food on the grass. Mary brought some juice, bread and biscuits to share with her friend. After they finished eating, her friend went to fly a kite. Mary gathered their waste bottles and paper and was about to threw them into the dustbin. Suddenly, she saw some garbage on the ground. She picked up the garbage, and threw it away with their waste bottles and paper. Her good behavior was noticed by the manager of the park. The manager praised her.\n" +
"1.7. Last weekend, Mary went outing with her classmates. Mary and her friend were having drinks and some bread. Others were flying kites or playing games. After a while, there were litters on the ground. Mary saw these and started to pick up all the waste paper and bottles. She put them into the dustbin. Mary's teacher praised her for what she had done.\n" +
"1.8. Mary went for an outing with her classmates last weekend. Some people played games and some people went to fly kites. Mary and Lily were having some snacks. When they were about to play, Mary noticed that there were litters around them. So she picked up the waste bottles and paper and threw them in the dustbin. Just then, her teacher saw it and praised Mary for what she did.\n" +
"1.9. The school held an outing last weekend. Mary and her classmates had fun there. Some people were playing games while some were flying kites. Mary and one of her classmates were having some snacks. Then, Mary found that there were some waste paper and bottles on the ground. So she threw all of them into the dustbin. At last, the ground became clean and Mary was praised by her teacher.\n" +
"1.10. Mary and her classmates went for an outing last weekend. They were very happy. Someone was flying kites, some were having food. After having lunch, they went on playing games. Mary noticed that there were some litters on the ground. So she picked up all the litters and then put them in the dustbin. Mary's good deed was saw by her teacher. The teacher praised Mary and felt proud of what she had done.\n" +
"1.11. Last Saturday, Mary's teacher took her class to an outing. The whole class were very happy then. Some people were flying kites while some were playing games. At lunch time, they had food and drank juice together. After that, there were some waste bottles and paper on the road. Mary started to pick them up and threw them into the dustbin. Her teacher saw it and spoke highly of what Mary had done. Mary felt very proud of herself.\n" +
"1.12. Last weekend Mary and her classmates went outing and had a picnic. Some people were flying kites, some people were having snacks. Suddenly, they found there was a lot of litter on the road. Mary picked up the waste bottles and paper the put them in the dustbin. The teacher praised Mary for her good behavior.\n" +
"1.13. Last weekend Mary went to the park with Some friends. Some of them were flying kites. Some friends were eating food. Suddenly, they saw there was some rubbish on the road. Mary picked up the rubbish and put it into the garbage. The teacher said Mary was good.\n" +
"1.14. Last weekend Mary went to the park. Some classmates were flying kites, some classmate were eating food. Suddenly, they saw there was a lot of rubbish on the road. Mary picked up the rubbish and put it into the dustbin. The teacher said Mary was a good girl.\n" +
"1.15. Last weekend Mary had a picnic with her cousins in the park. Some were flying kites, some were eating food. They saw there was some litter on the road. Mary picked up the litter and threw it into the dustbin. Her mother said Mary was good.\n" +
"1.16. Last weekend Mary had a picnic with her cousins in the park. Some flew kites, some ate food. Suddenly, they saw someone dropped a lot of litter on the road. Mary picked up the litter and threw it into the dustbin. Her mother said Mary did a good job.\n" +
"1.17. Last weekend, Mary went to the park for a picnic with her friend. They brought a lot of food and enjoyed it very much. Lily went to fly kite but she left many rubbish on the ground. Marry cleaned it and put it into the rubbish can. The teacher saw it and she said to Marry, \"you are a good girl.\" What a good girl!"
break
}
}
},
methods: {
async stopScore() {
if (await this.consumeBalance(this.user, "停止评测")) {
recorder.stop();
this.$message.success("录音评测停止,即将获取评测得分!")
}
},
async recordEvaluate() {
if (await this.consumeBalance(this.user, "开始语音评测")) {
await this.wsInit()
}
},
// 建立ws连接
async wsInit() {
this.$message.success("请开始朗读对应评测文本...")
let _this = this;
if (typeof (WebSocket) == 'undefined') {
console.log('您的浏览器不支持ws...')
} else {
console.log('您的浏览器支持ws!!!')
let reqeustUrl = await _this.getWebSocketUrl()
wsTask = new WebSocket(reqeustUrl);
// ws的几个事件,在vue中定义
wsTask.onopen = function () {
console.log('ws已经打开...')
wsFlag = true
// 第一帧数据
let params = {
"common": {
"app_id": atob(_this.user.appid)
},
"business": {
"rst": "entirety",
"ise_unite": "1",
"extra_ability": "syll_phone_err_msg;pitch;multi_dimension",
"category": _this.category,
"rstcd": "utf8",
"sub": "ise",
"ent": _this.ent,
"tte": "utf-8",
"cmd": "ssb",
"auf": "audio/L16;rate=16000",
"aue": "raw",
"text": _this.utf8bom + _this.iseContent // 评测文本
},
"data": {
"status": 0,
"data": ""
}
}
console.log("发送第一帧数据...")
wsTask.send(JSON.stringify(params)) // 执行发送
// 下面就可以循环发送中间帧了
// 开始录音
console.log("开始录音")
recorder.start({
sampleRate: 16000,
frameSize: 1280,
});
}
wsTask.onmessage = function (message) { // 调用第二个API 自动把语音转成文本
// console.log('收到数据===' + message.data)
let resJson = JSON.parse(message.data);
console.log(resJson)
if (resJson.data.status == 2) {
// alert("执行了")
let res = base64.decode(resJson.data.data)
console.log(res)
_this.iseContent = res
// 执行关闭ws
wsTask.close();
wsFlag = false
}
/* let jsonData = JSON.parse(message.data);
if (jsonData.data && jsonData.data.result) {
let data = jsonData.data.result;
let str = "";
let ws = data.ws;
for (let i = 0; i < ws.length; i++) {
str = str + ws[i].cw[0].w;
}
// 开启wpgs会有此字段(前提:在控制台开通动态修正功能)
// 取值为 "apd"时表示该片结果是追加到前面的最终结果;取值为"rpl" 时表示替换前面的部分结果,替换范围为rg字段
if (data.pgs) {
if (data.pgs === "apd") {
// 将resultTextTemp同步给resultText
_this.resultText = _this.resultTextTemp;
}
// 将结果存储在resultTextTemp中
_this.resultTextTemp = _this.resultText + str;
} else {
_this.resultText = _this.resultText + str;
}
_this.iatRes = _this.resultTextTemp || _this.resultText || "";
}
// 检测到结束或异常关闭
if (jsonData.code === 0 && jsonData.data.status === 2) { // 拿到最终的听写文本后,我们会调用大模型
// alert("执行了")
recorder.stop();
_this.$message.success("检测到您6秒没说话,报警自动结束上报,请稍后!")
let iatContent = {};
iatContent.content = _this.iatRes;
iatContent.ing = _this.ing;
iatContent.iat = _this.iat;
_this.$http.post("/big/big_model", iatContent).then(res => {
console.log(res);
if (res.data.code === "200") {
_this.modelRes = res.data.object;
_this.$message.success("报警成功,警员将尽快赶到!")
} else {
// console.log(res.data)
_this.$message.error(res.data.message);
}
})
wsTask.close();
wsFlag = false
}
if (jsonData.code !== 0) {
wsTask.close();
wsFlag = false
console.error(jsonData);
}*/
}
// 关闭事件
wsTask.onclose = function () {
console.log('ws已关闭...')
}
wsTask.onerror = function () {
console.log('发生错误...')
}
}
},
// 获取鉴权地址与参数
getWebSocketUrl() {
// alert("执行了")
return new Promise((resolve, reject) => {
// 请求地址根据语种不同变化
var url = this.URL;
var host = "ise-api.xfyun.cn";
var apiKeyName = "api_key";
var date = new Date().toGMTString();
var algorithm = "hmac-sha256";
var headers = "host date request-line";
var signatureOrigin = `host: ${host}\ndate: ${date}\nGET /v2/open-ise HTTP/1.1`;
var signatureSha = CryptoJS.HmacSHA256(signatureOrigin, atob(this.user.apisecret));
var signature = CryptoJS.enc.Base64.stringify(signatureSha);
var authorizationOrigin =
`${apiKeyName}="${atob(this.user.apikey)}", algorithm="${algorithm}", headers="${headers}", signature="${signature}"`;
var authorization = base64.encode(authorizationOrigin);
url = `${url}?authorization=${authorization}&date=${encodeURI(date)}&host=${host}`;
// console.log(url)
resolve(url); // 主要是返回地址
});
},
}
}
</script>
<style scoped>
</style>