Browse Source

图片变音预览

jsonwang 3 years ago
parent
commit
e1ddd2bc84

+ 9 - 1
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenImageManager.swift

@@ -59,7 +59,7 @@ class BFRecordScreenImageManager : BFRecordScreenBaseManager{
     }
     
     func checkCurrentPlayStatus(){
-        if let voice = recordItem?.voiceStickers.first(where: { mod in
+        if let voice = recordItem?.getUsedVoices().first(where: { mod in
             (mod.startCMTime - currentAssetProgress).seconds <= 0.05 && (mod.endCMTime - currentAssetProgress).seconds > 0.05
         }){
             let su = (recordPlayer?.currentItem?.asset as? AVURLAsset)?.url.lastPathComponent != (voice.wavFilePath as NSString?)?.lastPathComponent
@@ -127,6 +127,14 @@ class BFRecordScreenImageManager : BFRecordScreenBaseManager{
                         titleM.timelineIn = titleM.timelineIn - currDuration
                         titleM.timelineOut = titleM.timelineOut - currDuration
                     }
+                    //add by ak 修改变音的数据的开始结束时间
+                    let vcList = recordItem.voiceChangeStickers.filter { vc in
+                        vc.recordId == item.recordId
+                    }
+                    for voice in vcList {
+                        voice.startCMTime = voice.startCMTime - currDuration
+                        voice.endCMTime = voice.endCMTime - currDuration
+                    }
                 }
             }
             /// 重绘录音进度视图