瀏覽代碼

字幕设置初始化描边fix
吸附暂时关闭

harry 3 年之前
父節點
當前提交
e808083cbf

+ 3 - 3
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -493,13 +493,13 @@ public class BFRecordScreenController: BFBaseViewController {
                 let dicResult: [String: Any]? = jsonStringToDictionary(asrResult!)
                 let header = dicResult?["header"] as? [String: Any]
                 let payload = dicResult?["payload"] as? [String: Any]
-                BFLog(1, message: "识别结果:) \(payload?["result"] ?? "") ,taskId:\((header?["task_id"] as? String) ?? "taskId"), 识别时间:\(((payload?["begin_time"]) as? Int) ?? 0) ~ \(((payload?["time"]) as? Int) ?? 0) startTime:\(self?.recorderManager?.voiceModel?.startCMTime.seconds ?? 0.0)")
+                BFLog(1, message: "onNuiEventCallback event 识别结果:) \(payload?["result"] ?? "") ,taskId:\((header?["task_id"] as? String) ?? "taskId"), 识别时间:\(((payload?["begin_time"]) as? Int) ?? 0) ~ \(((payload?["time"]) as? Int) ?? 0) startTime:\(self?.recorderManager?.voiceModel?.startCMTime.seconds ?? 0.0)")
                 // 1,保存字幕数据 begin_time是开始出现文字的时间,time 是结束文字出现的时间 单位都为毫秒,都是相对于录制音频数据整段时间。self.recorderManager.voiceModel?.startCMTime.seconds 为开始的录制的时间,开始和结束都要加上这个时差
 
                 let newSubtitle = PQEditSubTitleModel()
                 // 任务全局唯一ID,请记录该值,便于排查问题。 每次 startRecorder 和 stopRecoder 之间  task_Id都不会变化
                 let taskID = header?["task_id"] as? String
-                let finish = header?["task_id"] as? String
+//                let finish = header?["task_id"] as? String
 
                 newSubtitle.taskID = taskID ?? ""
                 BFLog(1, message: "对应关系:字幕所属地址:taskID:\(taskID ?? ""),\((audioFilePath ?? "b").replacingOccurrences(of: documensDirectory, with: "")), 开始录音输入:\((self?.recorderManager?.voiceModel?.wavFilePath ?? "aa").replacingOccurrences(of: documensDirectory, with: ""))")
@@ -1359,7 +1359,7 @@ public class BFRecordScreenController: BFBaseViewController {
         hadPrepareToPlayRecord = false
         BFLog(1, message: "isDragingProgressSlder : \(isDragingProgressSlder)")
         BFLog(3, message: "重置播放index-\(#function) = \(currentPlayRecordIndex)")
-        searchStopAtRecordRange(needAdsorb: true)
+        searchStopAtRecordRange()
         changeWithDrawBtnLayout(0)
         isEndPlay = (progress == 1)
         recorderManager?.voiceModel = nil

+ 5 - 1
BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

@@ -165,6 +165,11 @@ class BFSubtitleSettingView: UIView {
                 make.centerY.equalTo(pointTitle.snp.centerY)
             }
         }
+        
+        let config = styleConfig[3]
+        subtitle.setting.subtitleSize = config?["subtitleSize"] as! Int
+        subtitle.setting.strokeWidth = CGFloat(config?["strokeWidth"] as? Double ?? 0.0)
+        
         // 就是一个线
         let line = UIView()
         line.backgroundColor = UIColor.hexColor(hexadecimal: "#121212")
@@ -234,7 +239,6 @@ class BFSubtitleSettingView: UIView {
         subtitle.setting.backgroundColor = config?["backgroundColor"] as! UIColor
         subtitle.setting.backgroundAlpha = Float(config?["backgroundAlpha"] as! Double)
         subtitle.setting.strokeColor = config?["strokeColor"] as! UIColor
-        subtitle.setting.strokeWidth =  CGFloat(config?["strokeWidth"] as! Double)
 
         if subtitleSettingCallBack != nil {
             subtitleSettingCallBack!(subtitle)