语音训练调整
This commit is contained in:
parent
f9d2d8a0ac
commit
21fe3c8b1e
@ -27,7 +27,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="录音">
|
||||
<template slot-scope="scope">
|
||||
<el-button class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" size="mini" type="primary" @click="startRecording(scope.row)">
|
||||
<el-button class="chat-box-footer-create chat-box-footer-send" :disabled="recordSendingId !== scope.row.id && !!recordSendingId" :class="{'active': recordSendingId == scope.row.id}" size="mini" type="primary" @click="startRecording(scope.row)">
|
||||
<el-progress class="record_progress_bar" type="circle" :show-text="false" :percentage="100/60*seconds" :width="40" :stroke-width="2" status="success" />
|
||||
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancleRecording()" />
|
||||
<span class="iconfont icon-yuyin"></span>
|
||||
@ -63,7 +63,8 @@ export default {
|
||||
seconds: 0,
|
||||
recordSending: false,
|
||||
recorders: null,
|
||||
microphone:null
|
||||
microphone:null,
|
||||
recordSendingId: null
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@ -220,6 +221,7 @@ export default {
|
||||
return resultData;
|
||||
},
|
||||
cancleRecording() {
|
||||
this.recordSendingId = null;
|
||||
if (this.microphone) {
|
||||
clearInterval(this.inter);
|
||||
this.seconds = 0;
|
||||
@ -232,6 +234,7 @@ export default {
|
||||
// 停止录制 发送语音
|
||||
stopRecording(actionId) {
|
||||
this.audioPlay = true;
|
||||
this.recordSendingId = null;
|
||||
const that = this;
|
||||
this.recorders.stopRecording(function(blobURL) {
|
||||
clearInterval(that.inter);
|
||||
@ -239,7 +242,7 @@ export default {
|
||||
const blob = that.recorders.getBlob();
|
||||
const fd = new FormData();
|
||||
fd.append('file', blob);
|
||||
uploadAudioFilesInSence(this.$route.query.sceneId, actionId, fd)
|
||||
uploadAudioFilesInSence(that.$route.query.sceneId, actionId, fd)
|
||||
.then((resp) => {
|
||||
that.audioPlay = false;
|
||||
resp.data.command = '';
|
||||
@ -286,6 +289,7 @@ export default {
|
||||
bitsPerSecond:256000,
|
||||
desiredSampRate: 16000
|
||||
});
|
||||
this.recordSendingId = row.id;
|
||||
that.recorders.startRecording();
|
||||
that.recordSending = true;
|
||||
that.audioPlay = false;
|
||||
|
Loading…
Reference in New Issue
Block a user