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

news2025/1/5 7:53:43

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

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

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

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

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

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

JVM对象创建过程

1 类加载检查 jvm通过new指令开始创建对象jvm执行new指令时&#xff0c;首先通过指令参数从常量池中取到需要创建的类名检查该类是否被加载&#xff0c;解析&#xff0c;和初始化过如果没有&#xff0c;则执行类的加载过程new指令对应到java语言具体的操作为 new 关键字创建对象…

什么是Sight Words(信号词)

&#x1f9e1;什么是Sight Words&#xff08;信号词&#xff09; 简单来说&#xff0c;Sight Words就是我们在日常英语中常用的一些基本词汇。可以把它想象成是学练英语的“基础词汇”&#xff0c;这些词在各种考试中经常出现&#xff0c;也是在生活中必不可少的。 &#x1f…

秒鲨后端之MyBatis【3】自定义映射resultMap、动态SQL、MyBatis的缓存、MyBatis的逆向工程、分页插件(30000字)

这里我分享一下尚硅谷的pdf100页笔记和代码&#xff0c;大家可以参考学习。 笔记&#xff1a; 通过网盘分享的文件&#xff1a;MyBatis.pdf 链接: https://pan.baidu.com/s/14Iu1Zs-_5vZoRjBEjmagag?pwdyjh6 提取码: yjh6 --来自百度网盘超级会员v1的分享代码&#xff1a; …

12.31【Linux】shell脚本【运行方式,修改环境变量,数组】思维导图 内附练习

1.思维导图 2练习&#xff1a; 1.尝试将下列指令放到脚本中运行 在家目录下创建目录文件dir1&#xff0c;把/etc/passwd拷贝到dir1中&#xff0c;把/etc/group拷贝到dir1中并重命名为grp.txt&#xff0c;使用tree指令&#xff0c;显示dir1目录的文件树&#xff0c;把dir1&am…

云计算学习架构篇之HTTP协议、Nginx常用模块与Nginx服务实战

一.HTTP协议讲解 1.1rsync服务重构 bash 部署服务端: 1.安装服务 [rootbackup ~]# yum -y install rsync 2.配置服务 [rootbackup ~]# vim /etc/rsyncd.conf uid rsync gid rsync port 873 fake super yes use chroot no max connections 200 timeout 600 ignore erro…

【项目】智能BI洞察引擎 测试报告

目录 一、项目背景BI介绍问题分析项目背景 二、项目功能三、功能测试1、登录测试测试用例测试结果 2、注册测试测试用例测试结果出现的bug 3、上传文件测试测试用例测试结果 4、AI生成图表测试测试用例测试结果 5、分析数据页面测试&#xff08;异步&#xff09;测试用例测试结…

权限菜单之菜单管理 SpringBoot + VUE

一、 数据表设计 新建表sys_menu 表内数据 添加实体类Menu package com.example.demo.demos.web.demo.entity;import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.Ta…

【AIGC篇】AIGC 引擎:点燃创作自动化的未来之火

&#xff1a;羑悻的小杀马特.-CSDN博客 未来都是惊喜。你生来本应为高山。并非草芥。 引言&#xff1a; 在当今数字化的时代&#xff0c;人工智能生成内容&#xff08;AIGC&#xff09;正以一种前所未有的力量改变着我们的创作领域。它就像一个神秘而强大的魔法师&#xff0c;…

UnityRenderStreaming使用记录(三)

测试UnityRenderStreaming在Ubuntu24.04.1LTS上的表现 先放上运行图操作系统 Ubuntu24.04.1LTSUnity测试工程环境相关修改遇到的问题 先放上运行图 操作系统 Ubuntu24.04.1LTS 系统下载地址 https://cn.ubuntu.com/download/desktop安装UnityHub https://blog.csdn.net/AWNUXC…

从0开始的docker镜像制作-ubuntu22.04

从0开始的docker镜像制作-ubuntu22.04 一、拉取基础ubuntu22.04镜像二、进入拉取的docker镜像中&#xff0c;下载自己需要的安装包三、安装需要的系统软件四、打包现有镜像为一个新的镜像五、推送打包的镜像到私有docker服务器1.编辑docker文件&#xff0c;使其允许http传输和对…

多模态论文笔记——CogVLM和CogVLM2(副)

大家好&#xff0c;这里是好评笔记&#xff0c;公主号&#xff1a;Goodnote&#xff0c;专栏文章私信限时Free。本文详细介绍多模态模型的LoRA版本——CogVLM和CogVLM2。在SD 3中使用其作为captioner基准模型的原因和优势。 文章目录 CogVLM论文背景VLMs 的任务与挑战现有方法及…

gitlab-runner的卸载与安装

如果你使用rpm方式安装gitlab-runner&#xff0c;则可以参考本教程。 卸载 停止和卸载gitlab-runner 停止 gitlab-runner stopchkconfig gitlab-runner off卸载 gitlab-runner uninstall删除rpm包 查询出rpm包名&#xff0c;根据包名删除rpm。 [rootEuler02 ~]# rpm -qa …

Nacos配置中心总结

Nacos配置中心总结 Nacos配置文件的加载顺序和优先级 加载顺序 nacos作为配置中心时&#xff0c;需要在bootstrap.yml文件中添加nacos config相关的配置&#xff0c;这样系统启动时就能先去拉取nacos server上的配置了。拉取过来后会和本地配置文件进行合并。 bootstrap.ym…

赛博周刊·2024年度工具精选(图片资源类)

1、EmojiSpark emoji表情包查找工具。 2、fluentui-emoji 微软开源的Fluent Emoji表情包。 3、开源Emoji库 一个开源的emoji库&#xff0c;目前拥有4000个emoji表情。 4、中国表情包大合集博物馆 一个专门收集中国表情包的项目&#xff0c;已收录5712张表情包&#xff0c;并…

Goland:专为Go语言设计的高效IDE

本文还有配套的精品资源&#xff0c;点击获取 简介&#xff1a;Goland是JetBrains公司开发的集成开发环境&#xff08;IDE&#xff09;&#xff0c;专为Go语言设计&#xff0c;提供了高效的代码编辑、强大的调试工具和丰富的项目管理功能。其智能代码补全、强大的调试与测试支…

小程序发版后,用户使用时,强制更新为最新版本

为什么要强制更新为最新版本&#xff1f; 在小程序的开发和运营过程中&#xff0c;强制用户更新到最新版本是一项重要的策略&#xff0c;能够有效提升用户体验并保障系统的稳定性与安全性。以下是一些主要原因&#xff1a; 1. 功能兼容 新功能或服务通常需要最新版本的支持&…

EasyExcel(环境搭建以及常用写入操作)

文章目录 EasyExcel环境搭建1.创建模块 easyexcel-demo2.引入依赖3.启动类创建 EasyExcel写1.最简单的写入1.模板2.方法3.结果 Write01.xlsx 2.指定字段不写入Excel1.模板2.方法3.结果 Write02.xlsx 3.指定字段写入excel1.模板2.方法3.结果 Write03.xlsx 4.按照index顺序写入ex…

典型常见的基于知识蒸馏的目标检测方法总结三

来源&#xff1a;Google学术2023-2024的顶会顶刊论文 NeurIPS 2022&#xff1a;Towards Efficient 3D Object Detection with Knowledge Distillation 为3D目标检测提出了一种知识蒸馏的Benchmark范式&#xff0c;包含feature的KD&#xff0c;Logit的cls和reg的KD&#xff0c…

通过Dockerfile来实现项目可以指定读取不同环境的yml包

通过Dockerfile来实现项目可以指定读取不同环境的yml包 1. 挂载目录2. DockerFile3. 运行脚本deploy.sh4. 运行查看日志进入容器 5. 接口测试修改application-dev.yml 6. 优化Dockerfile7. 部分参数解释8. 优化不同环境下的日志也不同调整 Dockerfile修改部署脚本 deploy.sh重新…

开源的go语言统一配置中心 - nacos + nacos go sdk

配置文件实时更新机制的场景需求 配置文件热更新主要应用于需要在不停机的情况下动态调整系统行为的场景&#xff0c;例如修改服务参数、切换数据源等。其原理在于通过一个中心化的管理平台来存储和分发最新的配置信息。当配置文件发生变化时&#xff0c;该平台会主动或被动地…