Commit d847ec3d by Ken Nakahira

提交更新代码

parent a01172b9
...@@ -512,6 +512,7 @@ export default { ...@@ -512,6 +512,7 @@ export default {
fontSize:0, fontSize:0,
boxHeight:210, boxHeight:210,
debouncedNextTips:null, debouncedNextTips:null,
processingDialogue:false,
quotedData:[] quotedData:[]
} }
}, },
...@@ -684,27 +685,31 @@ export default { ...@@ -684,27 +685,31 @@ export default {
this.loadingBG = true this.loadingBG = true
}, },
nextTips(){ nextTips(){
//结算当前语音的递归 进行下一次语音 // 结算当前语音的递归 进行下一次语音
// this.EPlayer.onEnded() // this.EPlayer.onEnded()
this.jumping = true this.$nextTick(() => {
clearInterval(this.Strem) this.jumping = true
this.EPlayer.stop() clearInterval(this.Strem)
if(!this.kill){ if(this.EPlayer) {
console.log('NextStr',this.str) this.EPlayer.stop()
this.yyds_pangbai += this.str }
} if(this.glod_dp && this.str != "") {
this.jumping = false console.log('Text Appended')
this.EPlayer.onended() this.realVoice(this.str)
}, } else {
updateDialogueDisplay(dialogue) { this.yyds_pangbai += this.str
uni.createSelectorQuery().in(this).select('#pangbaiContainer').boundingClientRect((res)=>{
if(res) {
res.innerHTML += dialogue;
} }
}).exec() this.str = ''
this.jumping = false
this.EPlayer.onended()
console.log('------------------')
});
},
realVoice(text){
this.yyds_dp = text
this.yyds_pangbai += " “ "+text+ " ” "
}, },
debounce(fn, interval) { debounce(fn, interval) {
console.log('Test A');
var timer; var timer;
var gapTime = interval;//间隔时间,如果interval不传,则默认1000ms var gapTime = interval;//间隔时间,如果interval不传,则默认1000ms
return function() { return function() {
...@@ -712,13 +717,13 @@ export default { ...@@ -712,13 +717,13 @@ export default {
var context = this; var context = this;
var args = arguments;//保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。 var args = arguments;//保存此处的arguments,因为setTimeout是全局的,arguments不是防抖函数需要的。
timer = setTimeout(function() { timer = setTimeout(function() {
fn.call(context,args); fn.apply(context,args);
}, gapTime); }, gapTime);
}; };
}, },
created() { created() {
// Bind the debounced version of nextTips // Bind the debounced version of nextTips
this.debouncedNextTips = this.debounce(this.nextTips, 300); this.debouncedNextTips = this.debounce(this.nextTips, 750);
}, },
handleCloseDialog(){ handleCloseDialog(){
this.show = false this.show = false
...@@ -1736,7 +1741,7 @@ export default { ...@@ -1736,7 +1741,7 @@ export default {
if (Cobj2.content != "") { if (Cobj2.content != "") {
setTimeout(() => { setTimeout(() => {
this.FetchAbuffer(Cobj2, voicer, Sarry) this.FetchAbuffer(Cobj2, voicer, Sarry)
}, 1000) }, 500)
} }
}).catch(err=>{ }).catch(err=>{
console.log(1223,err) console.log(1223,err)
...@@ -1765,7 +1770,7 @@ export default { ...@@ -1765,7 +1770,7 @@ export default {
if (Cobj.content != "") { if (Cobj.content != "") {
setTimeout(() => { setTimeout(() => {
this.FetchAbuffer_real(Cobj, voicer, Sarry) this.FetchAbuffer_real(Cobj, voicer, Sarry)
}, 1000) }, 500)
} }
}) })
}, },
...@@ -1780,40 +1785,42 @@ export default { ...@@ -1780,40 +1785,42 @@ export default {
// const voicer = arrObj[0].quoted ? this.currentPageData.voiceGroups[1] : this.currentPageData.voiceGroups[0]; // const voicer = arrObj[0].quoted ? this.currentPageData.voiceGroups[1] : this.currentPageData.voiceGroups[0];
let arrObj = data; let arrObj = data;
console.log('arrObj_execFile',arrObj)
const content = arrObj[0].text; const content = arrObj[0].text;
const voicer = arrObj[0].voicer; const voicer = arrObj[0].voicer;
this.GoSay(content,voicer,(text, falg)=>{ this.GoSay(content,voicer,(text, falg)=>{
if(arrObj[0].quoted){ if(!arrObj || arrObj.length == 0) {return}
if(text!==""&&!falg){ if(arrObj[0].quoted){
this.glod_dp = true if(text!==""&&!falg){
// this.glod_user = false console.log('Quote Added')
this.yyds_dp = text this.glod_dp = true
this.yyds_pangbai += " “ "+text+ " ” " // this.glod_user = false
} this.yyds_dp = text
if (falg) { this.yyds_pangbai += " “ "+text+ " ” "
console.log('GoSound讲话完毕!') }
arrObj.shift() if (falg) {
console.log('arrObj',arrObj) console.log('GoSound讲话完毕!')
if(arrObj.length!==0){ arrObj.shift()
this.execFile(arrObj) console.log('arrObj',arrObj)
} if(arrObj.length!==0){
} this.execFile(arrObj)
}else{ }
if(text!==""&&!falg){ }
this.kill = false }else {
this.delayText(text) if (text !== "" && !falg) {
} this.kill = false
if (falg) { this.delayText(text)
console.log('GoSay讲话完毕!') }
this.kill = true if (falg) {
arrObj.shift() console.log('GoSay讲话完毕!')
console.log('arrObj',arrObj) this.kill = true
if(arrObj.length!==0){ arrObj.shift()
this.execFile(arrObj) console.log('arrObj', arrObj)
} if (arrObj.length !== 0) {
} this.execFile(arrObj)
} }
}
}
}) })
// if(this.soundVoice[voicer]){ // if(this.soundVoice[voicer]){
...@@ -1873,7 +1880,7 @@ export default { ...@@ -1873,7 +1880,7 @@ export default {
if(count.length==0){ if(count.length==0){
clearInterval(this.Strem) clearInterval(this.Strem)
} }
}, 100); }, 50);
}, },
createSSML(text, voiceName) { createSSML(text, voiceName) {
...@@ -1889,11 +1896,13 @@ export default { ...@@ -1889,11 +1896,13 @@ export default {
// GoSound 真人音线 // GoSound 真人音线
GoSound(content, voicer, CB) { GoSound(content, voicer, CB) {
// 要读的文字 声线 回调 // 要读的文字 声线 回调
console.log('First')
const that = this const that = this
let Sarry = []; let Sarry = [];
this.Cobj = this.computeLen({ content }); this.Cobj = this.computeLen({ content });
this.str = this.Cobj.Sr
this.glod_dp = true
uni.request({ uni.request({
url: 'https://admin.mindepoch.com:8089/VoiceMode/GetVoiceEcho', url: 'https://admin.mindepoch.com:8089/VoiceMode/GetVoiceEcho',
method: 'post', method: 'post',
...@@ -1969,6 +1978,8 @@ export default { ...@@ -1969,6 +1978,8 @@ export default {
that.jumping = false that.jumping = false
Rfunc() Rfunc()
}else{ }else{
console.log('Checkpoint')
this.str = Sobj.S
that.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`; that.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`;
FileSystemManager.writeFile({ FileSystemManager.writeFile({
filePath: that.tempFilePath2, filePath: that.tempFilePath2,
...@@ -1995,7 +2006,7 @@ export default { ...@@ -1995,7 +2006,7 @@ export default {
if (that.Cobj.content != "") { if (that.Cobj.content != "") {
setTimeout(() => { setTimeout(() => {
that.FetchAbuffer_real(that.Cobj, voicer, Sarry, CB) that.FetchAbuffer_real(that.Cobj, voicer, Sarry, CB)
}, 5000) }, 2000)
} }
}, },
fail:(err)=>{ fail:(err)=>{
...@@ -2051,6 +2062,7 @@ export default { ...@@ -2051,6 +2062,7 @@ export default {
console.log('oooGoSayooo') console.log('oooGoSayooo')
this.EPlayer.cb = CB this.EPlayer.cb = CB
var Rfunc = () => { var Rfunc = () => {
console.log('Sarry',Sarry)
if(this.jumping){ if(this.jumping){
return return
} }
...@@ -2088,6 +2100,8 @@ export default { ...@@ -2088,6 +2100,8 @@ export default {
this.jumping = false this.jumping = false
Rfunc() Rfunc()
}else{ }else{
console.log('Checkpoint')
this.str = Sobj.S
this.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`; this.tempFilePath2 = wx.env.USER_DATA_PATH + `/tempAudio_${new Date().getTime()}.mp3`;
// const mark = that.Cobj2.Sr // const mark = that.Cobj2.Sr
FileSystemManager.writeFile({ FileSystemManager.writeFile({
...@@ -2113,7 +2127,7 @@ export default { ...@@ -2113,7 +2127,7 @@ export default {
if (this.Cobj2.content != "") { if (this.Cobj2.content != "") {
setTimeout(() => { setTimeout(() => {
this.FetchAbuffer(this.Cobj2, voicer, Sarry, CB) this.FetchAbuffer(this.Cobj2, voicer, Sarry, CB)
}, 5000) }, 2000)
} }
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment