Explorar o código

已经停止状态逻辑处理

jsonwang %!s(int64=3) %!d(string=hai) anos
pai
achega
fbdcd3ace7
Modificáronse 1 ficheiros con 10 adicións e 3 borrados
  1. 10 3
      BFRecordScreenKit/Classes/BFVoiceRecordManager.swift

+ 10 - 3
BFRecordScreenKit/Classes/BFVoiceRecordManager.swift

@@ -65,9 +65,16 @@ class BFVoiceRecordManager: NSObject {
     /// 停止录制
     /// - Parameter isCancel: 是否为取消 ,取消操作会把录制的文件删除和字幕删除
     func stopRecord(isCancel: Bool) {
-        isStoping = true
-        mIsCancel = isCancel
-        audioRecorder?.stopRecord()
+        
+        //STATE_STOP
+        if(!(audioRecorder?.voiceRecorder.isStoped() ?? false)){
+            isStoping = true
+            mIsCancel = isCancel
+            audioRecorder?.stopRecord()
+        }else{
+            BFLog(2, message: "已经是停止状态")
+        }
+     
     }
 }