|
@@ -1209,8 +1209,11 @@ CH:${_CH}
|
|
|
},
|
|
|
//文本转录
|
|
|
wavAudioToTextAndObjMixin(data) {
|
|
|
- return new Promise((resolve) => {
|
|
|
+ return new Promise(async (resolve) => {
|
|
|
let { wavUrl } = data;
|
|
|
+
|
|
|
+ let wavBlob = await getFileBody(wavUrl)
|
|
|
+ const audioFile = new File([wavBlob.data], 'audio.wav', { type: 'audio/wav' });
|
|
|
let iframeRef = this.$refs["iframeRef"];
|
|
|
iframeRef.contentWindow.window.document.getElementById(
|
|
|
"languageOptions"
|
|
@@ -1285,23 +1288,12 @@ CH:${_CH}
|
|
|
blob.name = `classroomObservation.txt`;
|
|
|
this.uploadFileMixin(blob).then(upload => {
|
|
|
resolve({ transcriptionContent: transcriptionContent, editorBarData: { type: "0", url: upload.Location, content: tableContent, tableList: tableList } })
|
|
|
- // this.ajax
|
|
|
- // .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
|
|
|
- // url: upload.Location
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // let resData = res.data.FunctionResponse;
|
|
|
- // if (resData.result && resData.result.id) {
|
|
|
- // resolve({ fileId: resData.result.id, editorBarData: { type: "0", url: upload.Location }, })
|
|
|
- // }
|
|
|
- // })
|
|
|
})
|
|
|
- // resolve({ transcriptionContent: transcriptionContent, tableContent: tableContent, tableList: tableList })
|
|
|
};
|
|
|
|
|
|
//开始转录
|
|
|
iframeRef.contentWindow.ConversationTranscriber({
|
|
|
- files: [_file]
|
|
|
+ files: [audioFile]
|
|
|
});
|
|
|
})
|
|
|
|