jsonwang 3 лет назад
Родитель
Сommit
6075f85ee0

+ 29 - 0
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -2826,6 +2826,35 @@ extension BFRecordScreenController: BFTTSManagerDelegte{
         }
         
     }
+ 
+    public func ttsDebugHandle(_ msg:String, isShow: Bool){
+        BFLog(message: "TTS 出现错误\(msg)")
+        let alertController = UIAlertController(title: "哎呀,变声失败了",
+                       message: "", preferredStyle: .alert)
+        let cancelAction = UIAlertAction(title: "取消变音", style: .default, handler: {[weak self]
+            action in
+             guard let wself = self else { return }
+            //不使用变音数据 缓存都要清空
+            wself.tts?.tasksCache.removeAllObjects()
+            for itemModel in wself.itemModels{
+                 itemModel.voiceChangeStickers.removeAll()
+            }
+
+         })
+
+        let okAction = UIAlertAction(title: "重试", style: .cancel, handler: {[weak self]
+           action in
+            guard let wself = self else { return }
+            wself.tts?.runNextTask()
+        })
+        okAction.setValue(UIColor.red, forKey:"titleTextColor")
+        alertController.addAction(okAction)
+        alertController.addAction(cancelAction)
+
+        self.present(alertController, animated: true, completion: nil)
+        
+    }
+    
     
     /// 查看发音人文件是否已经全都完成,如果没有完成不能进行预览,合成操作
     /// - Parameter itemIndex: 段落 ID ,不传值是所有段落