|
@@ -458,11 +458,11 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
CMTimeCompare(m.startCMTime, currentAssetProgress) <= 0 && CMTimeCompare(m.endCMTime, currentAssetProgress) > 0
|
|
CMTimeCompare(m.startCMTime, currentAssetProgress) <= 0 && CMTimeCompare(m.endCMTime, currentAssetProgress) > 0
|
|
|
|
|
|
}) {
|
|
}) {
|
|
- BFLog(message: "找到音频开始时间:\(mod.startCMTime.seconds)结束 \(mod.endCMTime.seconds) currentAssetProgress is \(currentAssetProgress.seconds)")
|
|
|
|
|
|
+ BFLog(message: "找到音频开始时间:\(mod.startCMTime.seconds)结束 \(mod.endCMTime.seconds) currentAssetProgress is \(currentAssetProgress.seconds) wavFilePath:\(mod.wavFilePath ?? "")")
|
|
|
|
|
|
// 当前播放的文件
|
|
// 当前播放的文件
|
|
if playingVoiceMode == mod {
|
|
if playingVoiceMode == mod {
|
|
- BFLog(2,message: "找查到mod的已经播放完成同一个")
|
|
|
|
|
|
+ BFLog(2,message: "找查到mod的已经播放完成同一个 wavFilePath:\(mod.wavFilePath ?? "")")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
playingVoiceMode = mod
|
|
playingVoiceMode = mod
|
|
@@ -488,9 +488,8 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
let outTime = ttsAudioAsset.duration.seconds - (mod.endCMTime - mod.startCMTime).seconds
|
|
let outTime = ttsAudioAsset.duration.seconds - (mod.endCMTime - mod.startCMTime).seconds
|
|
BFAudioPlayer.shared.delegate = self
|
|
BFAudioPlayer.shared.delegate = self
|
|
BFAudioPlayer.shared.configPlayer(audioPathURL: URL(fileURLWithPath: mod.wavFilePath))
|
|
BFAudioPlayer.shared.configPlayer(audioPathURL: URL(fileURLWithPath: mod.wavFilePath))
|
|
- //如果音频比原来的字幕时间要长,动态加速保证和字幕时长一致。
|
|
|
|
- BFAudioPlayer.shared.player?.rate = Float(outTime > 0 ? ttsAudioAsset.duration.seconds / (mod.endCMTime - mod.startCMTime).seconds : 1.0)
|
|
|
|
-
|
|
|
|
|
|
+ //如果音频比原来的字幕时间要长,动态加速保证和字幕时长一致。 0.1多算一点音频时长,也就是让更快速度播放一些 XXXX
|
|
|
|
+ BFAudioPlayer.shared.player?.rate = Float(outTime > 0 ? (ttsAudioAsset.duration.seconds + 0.1) / (mod.endCMTime - mod.startCMTime).seconds : 1.0)
|
|
|
|
|
|
let tt = currentAssetProgress - mod.startCMTime
|
|
let tt = currentAssetProgress - mod.startCMTime
|
|
BFLog(1, message: "record - tt: \(tt.seconds), curr:\(currentAssetProgress.seconds) \(needPlay) rate:\(BFAudioPlayer.shared.player?.rate ?? -1) 音频比字幕显示时间长 :\(outTime) \(mod.wavFilePath ?? "")")
|
|
BFLog(1, message: "record - tt: \(tt.seconds), curr:\(currentAssetProgress.seconds) \(needPlay) rate:\(BFAudioPlayer.shared.player?.rate ?? -1) 音频比字幕显示时间长 :\(outTime) \(mod.wavFilePath ?? "")")
|