提升口语发音水平,中英文发音评测系统实现

在全球化的浪潮中,语言不再是障碍,而是连接世界的桥梁。掌握一门流利的英语,意味着打开了通往世界的大门。但是,如何确保你的英语口语如同母语者一样自然流畅?这正是我们存在的意义。

我们的中英文口语发音评测服务,采用最先进的语音识别技术和人工智能算法,为你提供专业、精准的发音评估。无论你是英语初学者还是希望进一步提高发音的学习者,我们的系统都能为你量身定制反馈,帮助你快速提高。

  • 个性化反馈:我们的系统能够精确识别你的发音问题,并提供针对性的改进建议。
  • 实时评分:通过即时评分功能,你可以直观了解自己的进步和需要加强的地方。
  • 互动学习:结合有趣的互动练习,让学习过程不再枯燥,效率更高。
  • 进度追踪:记录你的学习历程,让你清晰地看到每一步的成长。

加入我们,让我们一起跨越语言的障碍,用流利的英语开启你的全球之旅。无论是职场竞争还是日常交流,优秀的口语能力都将是你最强有力的支持。现在就来体验,让我们帮你把每一个音节雕琢得更加完美!

<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>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/946393.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

C语言初阶习题【20】扫雷游戏

1.用C语言实现扫雷游戏 本博客和三子棋游戏比较大的区别是&#xff0c;三子棋游戏是写完了再总结的&#xff0c;本博客是边代码实现边编辑博客&#xff0c;所以本博客会比较详细的po出每一步骤&#xff0c;在每实现一个小功能的时候我们都先验证下效果&#xff0c;再继续下一步…

Python AI教程之七:多项式回归

多项式回归的实现 多项式回归是一种线性回归,其中独立变量 x 和因变量 y 之间的关系被建模为n 次多项式。多项式回归拟合 x 的值与 y 的相应条件均值之间的非线性关系,表示为 E(y | x)。在本文中,我们将深入探讨多项式回归。 目录 什么是多项式回归? 为什么采用多项式回归…

【Leetcode】3280. 将日期转换为二进制表示

文章目录 题目思路代码复杂度分析时间复杂度空间复杂度 结果总结 题目 题目链接&#x1f517; 给你一个字符串 date&#xff0c;它的格式为 yyyy-mm-dd&#xff0c;表示一个公历日期。 date 可以重写为二进制表示&#xff0c;只需要将年、月、日分别转换为对应的二进制表示&a…

网段划分和 IP 地址

1. IP 协议 IP 协议是网络层协议&#xff0c;主要负责在不同网络设备之间&#xff0c;进行数据包的地址分配和路由选择。 地址分配&#xff1a;为每个连接到公网的设备分配一个唯一的 IP 地址&#xff0c;确保数据能被准确地发送到目标设备。 数据分片和组装&#xff1a;当发…

【Python系列】Python 中对对象列表进行排序

&#x1f49d;&#x1f49d;&#x1f49d;欢迎来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里可以感受到一份轻松愉快的氛围&#xff0c;不仅可以获得有趣的内容和知识&#xff0c;也可以畅所欲言、分享您的想法和见解。 推荐:kwan 的首页,持续学…

微服务のGeteWay

目录 概念&#xff1a; 三大核心&#xff1a; 工作流程&#xff1a; 9527网关如何做路由映射&#xff1a; GetWay高级特性&#xff1a; 按服务名动态路由服务&#xff1a; 断言Route Predicate Factories &#xff1a; 获取当前时区时间&#xff1a; After Route &…

数字图像处理 三 空间滤波

空间滤波是一种图像处理技术&#xff0c;它通过对图像像素及其邻域进行运算&#xff0c;利用均值&#xff0c;高斯&#xff0c;梯度&#xff0c;拉普拉斯等线性滤波和中值&#xff0c;最大最小&#xff0c;双边滤波等非线性滤波改变像素值&#xff0c;实现图像的平滑&#xff0…

【CVE-2024-12987 】DrayTek 网关设备中 `apmcfgupload` 端点的命令注入漏洞

概述 DrayTek 网关设备(包括 Vigor2960 和 Vigor300B 型号)存在通过 Web 管理接口进行命令注入的漏洞。攻击者可以通过发送恶意的 HTTP 请求到 /cgi-bin/mainfunction.cgi/apmcfgupload 端点,利用该漏洞注入任意命令,从而影响超过 66,000 台连接到互联网的设备。 受影响的…

mac下载Homebrew安装nvm

通过Homebrew安装 - 国内下载地址 /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"安装nvm brew install nvm 配置nvm环境变量 export NVM_DIR“$HOME/.nvm” [ -s “/usr/local/opt/nvm/nvm.sh” ] && . “/usr/…

[react] 纯组件优化子

有组件如下,上面变化秒数, 下面是大量计算的子组件,上面每一秒钟变化一次,这时候子组件会不断重新渲染, 浪费资源 父组件如下 import React, { memo, useEffect, useMemo, useState } from react; import type { ReactNode, FC } from react; import HugeCount from ./Te; int…

Unity Mesh生成Cube

1. 配置一个Cube的每个面的数据 一共是6个面&#xff0c;每个面包含的数据包括4个顶点的相对顶点坐标&#xff08;Cube的中心为原点&#xff09;&#xff0c;法线方向&#xff0c;UV坐标&#xff0c;顶点渲染顺序&#xff0c;以及这个面用到的材质&#xff0c;因为这里是Top&am…

Spring--三级缓存机制

一、什么是三级缓存 就是在Bean生成流程中保存Bean对象三种形态的三个Map集合&#xff0c;如下&#xff1a; // 一级缓存Map 存放完整的Bean&#xff08;流程跑完的&#xff09; private final Map<String, Object> singletonObjects new ConcurrentHashMap(256);// 二…

使用R语言绘制标准的中国地图和世界地图

在日常的学习和生活中&#xff0c;有时我们常常需要制作带有国界线的地图。这个时候绘制标准的国家地图就显得很重要。目前国家标准地图服务系统向全社会公布的标准中国地图数据&#xff0c;是最权威的地图数据。 今天介绍的R包“ggmapcn”&#xff0c;就是基于最新公布的地图…

2025考研江南大学复试科目控制综合(初试807自动控制原理)

​ 2025年全国硕士研究生招生考试江南大学考点 一年年的考研如期而至&#xff0c;我也变成了研二了&#xff0c;作为2次考研经历的学长&#xff0c;总是情不自禁地回想起自己的考研经历&#xff0c;我也会经常从那段经历中汲取力量。我能理解大多数考生考完后的的迷茫无助&…

WebApi使用 (.Net Framework版)

1 创建 使用.Net做web后端&#xff0c;推荐使用.Net Core&#xff0c;微软在此基础上做了很多适配&#xff0c;包括内置Swagger&#xff0c;可以直接启动等等。而.Net Framework版&#xff0c;需要手动配置很多内容。 如果需要调用的项目是基于.Net Framework&#xff0c;那么…

使用 ASP.NET Core wwwroot 上传和存储文件

在 ASP.NET Core 应用程序中上传和存储文件是用户个人资料、产品目录等功能的常见要求。本指南将解释使用wwwroot存储图像&#xff08;可用于文件&#xff09;的过程以及如何在应用程序中处理图像上传。 步骤 1&#xff1a;设置项目环境 确保您的 ASP.NET 项目中具有必要的依…

2024年中国新能源汽车用车发展怎么样 PaperGPT(一)

概述 在国家政策的强力扶持下&#xff0c;2024年中国新能源汽车市场迎来了新的发展机遇。本文将基于《中国新能源汽车用车报告&#xff08;2024年&#xff09;》的数据&#xff0c;对新能源汽车的市场发展和用车趋势概述。 新能源汽车市场发展 政策推动&#xff1a;国家和地…

[论文粗读]A Simple Framework for Contrastive Learning of Visual Representations

引言 今天带来一篇经典论文A Simple Framework for Contrastive Learning of Visual Representations的笔记。 本篇工作提出了SimCLR&#xff0c;一种用于视觉表征对比学习的简单框架。提出(1)数据增强组合在定义有效预测任务中起到至关重要的作用&#xff1b;(2)在表示和对比…

(leetcode算法题)188. 买卖股票的最佳时机 IV

题目中要求最多可以完成k次交易&#xff0c;很多时候不要把问题搞复杂了&#xff0c; 按照题目要求&#xff0c;研究对象是最后一天结束后最多进行了 k 次交易获得的最大利润 那么就可以把问题拆分成 第 1 天结束后完成 0 次交易获得的最大利润&#xff0c;第 1 天结束后完成…

使用 Docker 搭建 Hadoop 集群

1.1. 启用 WSL 与虚拟机平台 1.1.1. 启用功能 启用 WSL并使用 Moba 连接-CSDN博客 1.2 安装 Docker Desktop 最新版本链接&#xff1a;Docker Desktop: The #1 Containerization Tool for Developers | Docker 指定版本链接&#xff1a;Docker Desktop release notes | Do…