|
@@ -482,17 +482,12 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- let ttsAudioAsset = AVURLAsset(url: URL(fileURLWithPath: mod.wavFilePath), options: avAssertOptions)
|
|
|
-
|
|
|
- let outTime = ttsAudioAsset.duration.seconds - (mod.endCMTime - mod.startCMTime).seconds
|
|
|
+
|
|
|
BFAudioPlayer.shared.delegate = self
|
|
|
BFAudioPlayer.shared.configPlayer(audioPathURL: URL(fileURLWithPath: mod.wavFilePath))
|
|
|
- //如果音频比原来的字幕时间要长,动态加速保证和字幕时长一致。 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
|
|
|
- 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) \(mod.wavFilePath ?? "")")
|
|
|
if CMTimeCompare(tt, .zero) == 0 {
|
|
|
if needPlay {
|
|
|
audioPlayerIsPlaying = true
|