Sfoglia il codice sorgente

Merge branch 'lhd'

natasha 1 settimana fa
parent
commit
92e98883a5

+ 2 - 1
package.json

@@ -45,7 +45,8 @@
     "vue-router": "^3.6.5",
     "vue-signature-pad": "^2.0.5",
     "vuedraggable": "^2.24.3",
-    "vuex": "^3.6.2"
+    "vuex": "^3.6.2",
+    "web-highlighter": "^0.7.4"
   },
   "devDependencies": {
     "@babel/core": "^7.28.5",

+ 8 - 0
src/api/app.js

@@ -138,3 +138,11 @@ export function GetTextToAudioConfParamList() {
 export function GetSysVersionInfo() {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=login_control-GetSysVersionInfo`);
 }
+
+/**
+ * 拼音转音频文件-有音色配置
+ * @param {object} data 请求数据
+ */
+export function PinyinToAudioFile(data) {
+  return http.post(`${process.env.VUE_APP_EepServer}?MethodName=tool-PinyinToAudioFile`, data);
+}

+ 5 - 4
src/views/book/courseware/create/components/question/pinyin_base/PinyinBase.vue

@@ -83,7 +83,7 @@ import UploadAudio from '@/views/book/courseware/create/components/question/fill
 import { getPinyinBaseData, funList } from '@/views/book/courseware/data/pinyinBase';
 import { addTone, handleToneValue } from '@/views/book/courseware/data/common';
 import { getRandomNumber } from '@/utils';
-import { GetStaticResources, TextToAudioFile } from '@/api/app';
+import { TextToAudioFile, PinyinToAudioFile } from '@/api/app';
 
 export default {
   name: 'PinyinBasePage',
@@ -129,7 +129,6 @@ export default {
     },
     // 自动生成音频
     handleMatically() {
-      let MethodName = 'tool-TextToVoiceFile';
       let data = {};
       if (this.data.character.trim() || this.data.content_hz) {
         data = {
@@ -150,11 +149,13 @@ export default {
         if (!this.matically_pinyin_obj[this.data.mark]) {
           this.handleItemAnswer(this.data);
         }
-        MethodName = 'tool-PinyinToVoiceFile';
         data = {
           pinyin: this.matically_pinyin_obj[this.data.mark],
+          voice_type: this.data.property.voice_type,
+          emotion: this.data.property.emotion,
+          type: 1,
         };
-        GetStaticResources(MethodName, data)
+        PinyinToAudioFile(data)
           .then((res) => {
             if (res.status === 1) {
               this.data.audio_file_id = res.file_id;