瀏覽代碼

1,停止时 不在使用状态判断 ,都在内部处理

jsonwang 3 年之前
父節點
當前提交
158b150d5d
共有 1 個文件被更改,包括 6 次插入10 次删除
  1. 6 10
      BFRecordScreenKit/Classes/BFVoiceRecordManager.swift

+ 6 - 10
BFRecordScreenKit/Classes/BFVoiceRecordManager.swift

@@ -48,6 +48,7 @@ class BFVoiceRecordManager: NSObject {
 
     /// 开始录音
     func startRecord() {
+        BFLog(2, message: "开始录音 \(Date().timeIntervalSince1970)")
         if isStoping {
             BFLog(2, message: "正在停止中,这次开始无效.")
             return
@@ -75,16 +76,11 @@ class BFVoiceRecordManager: NSObject {
     /// 停止录制
     /// - Parameter isCancel: 是否为取消 ,取消操作会把录制的文件删除和字幕删除
     func stopRecord(isCancel: Bool) {
-        
-        //STATE_STOP
-        if(!(audioRecorder?.voiceRecorder.isStoped() ?? false)){
-            isStoping = true
-            mIsCancel = isCancel
-            audioRecorder?.stopRecord()
-        }else{
-            BFLog(2, message: "已经是停止状态")
-        }
-     
+        BFLog(2, message: "结束录音 \(Date().timeIntervalSince1970)")
+        isStoping = true
+        mIsCancel = isCancel
+        audioRecorder?.stopRecord()
+ 
     }
 }