|
|
@ -287,9 +287,9 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 如果所有音频都是导语,返回第一个音频的索引 |
|
|
|
|
|
console.log('🎵 findFirstNonLeadAudio: 所有音频都是导语,返回第一个音频索引=0'); |
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
// 如果所有音频都是导语,返回 -1 表示不播放 |
|
|
|
|
|
console.log('🎵 findFirstNonLeadAudio: 所有音频都是导语,返回 -1 不播放'); |
|
|
|
|
|
return -1; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 检查并自动加载预加载完成的音频 |
|
|
// 检查并自动加载预加载完成的音频 |
|
|
@ -324,7 +324,7 @@ export default { |
|
|
|
|
|
|
|
|
// 初始化音频索引为第一个非导语音频 |
|
|
// 初始化音频索引为第一个非导语音频 |
|
|
const firstNonLeadIndex = this.findFirstNonLeadAudio(); |
|
|
const firstNonLeadIndex = this.findFirstNonLeadAudio(); |
|
|
this.currentAudioIndex = firstNonLeadIndex >= 0 ? firstNonLeadIndex : 0; |
|
|
|
|
|
|
|
|
this.currentAudioIndex = firstNonLeadIndex; |
|
|
this.currentTime = 0; |
|
|
this.currentTime = 0; |
|
|
this.currentHighlightIndex = -1; |
|
|
this.currentHighlightIndex = -1; |
|
|
|
|
|
|
|
|
@ -618,7 +618,7 @@ export default { |
|
|
|
|
|
|
|
|
// 初始化音频索引为第一个非导语音频 |
|
|
// 初始化音频索引为第一个非导语音频 |
|
|
const firstNonLeadIndex = this.findFirstNonLeadAudio(); |
|
|
const firstNonLeadIndex = this.findFirstNonLeadAudio(); |
|
|
this.currentAudioIndex = firstNonLeadIndex >= 0 ? firstNonLeadIndex : 0; |
|
|
|
|
|
|
|
|
this.currentAudioIndex = firstNonLeadIndex; |
|
|
this.isPlaying = false; |
|
|
this.isPlaying = false; |
|
|
this.currentTime = 0; |
|
|
this.currentTime = 0; |
|
|
this.hasAudioData = true; |
|
|
this.hasAudioData = true; |
|
|
@ -932,10 +932,10 @@ export default { |
|
|
// 检查音色ID是否匹配 |
|
|
// 检查音色ID是否匹配 |
|
|
if (cachedData.voiceId && cachedData.voiceId !== this.localVoiceId) { |
|
|
if (cachedData.voiceId && cachedData.voiceId !== this.localVoiceId) { |
|
|
console.warn('缓存音色不匹配:', cachedData.voiceId, '!=', this.localVoiceId); |
|
|
console.warn('缓存音色不匹配:', cachedData.voiceId, '!=', this.localVoiceId); |
|
|
uni.showToast({ |
|
|
|
|
|
title: '音色已切换,请重新获取音频', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: '音色已切换,请重新获取音频', |
|
|
|
|
|
// icon: 'none' |
|
|
|
|
|
// }); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -982,10 +982,10 @@ export default { |
|
|
|
|
|
|
|
|
// 检查是否有音色ID |
|
|
// 检查是否有音色ID |
|
|
if (!this.localVoiceId) { |
|
|
if (!this.localVoiceId) { |
|
|
uni.showToast({ |
|
|
|
|
|
title: '音色未加载,请稍后重试', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: '音色未加载,请稍后重试', |
|
|
|
|
|
// icon: 'none' |
|
|
|
|
|
// }); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -2112,16 +2112,12 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 显示成功提示 |
|
|
// 显示成功提示 |
|
|
uni.showToast({ |
|
|
|
|
|
title: '✅ 倍速功能可用', |
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
duration: 1500 |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
// title: '✅ 倍速功能可用', |
|
|
|
|
|
// icon: 'none', |
|
|
|
|
|
// duration: 1500 |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('💥 检测播放速度支持时出错:', error); |
|
|
console.error('💥 检测播放速度支持时出错:', error); |
|
|
@ -2829,12 +2825,18 @@ export default { |
|
|
|
|
|
|
|
|
// 查找第一个非导语音频 |
|
|
// 查找第一个非导语音频 |
|
|
const firstNonLeadIndex = this.findFirstNonLeadAudio(); |
|
|
const firstNonLeadIndex = this.findFirstNonLeadAudio(); |
|
|
this.currentAudioIndex = firstNonLeadIndex >= 0 ? firstNonLeadIndex : 0; |
|
|
|
|
|
|
|
|
this.currentAudioIndex = firstNonLeadIndex; |
|
|
this.currentTime = 0; |
|
|
this.currentTime = 0; |
|
|
this.isPlaying = false; |
|
|
this.isPlaying = false; |
|
|
|
|
|
|
|
|
console.log(`🎵 autoPlayCachedAudio: 设置起始索引为${this.currentAudioIndex}(跳过导语)`); |
|
|
console.log(`🎵 autoPlayCachedAudio: 设置起始索引为${this.currentAudioIndex}(跳过导语)`); |
|
|
|
|
|
|
|
|
|
|
|
// 如果所有音频都是导语,不播放 |
|
|
|
|
|
if (firstNonLeadIndex < 0) { |
|
|
|
|
|
console.log('🎵 autoPlayCachedAudio: 所有音频都是导语,不播放'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 延迟一下再开始播放,确保UI更新完成 |
|
|
// 延迟一下再开始播放,确保UI更新完成 |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
this.playAudio(); |
|
|
this.playAudio(); |
|
|
|