Browse Source

Merge branch 'master' of https://git.yishihui.com/iOS/BFRecordScreenKit

* 'master' of https://git.yishihui.com/iOS/BFRecordScreenKit:
  关闭降噪方法
harry 3 years ago
parent
commit
7bc2920d46
1 changed files with 9 additions and 9 deletions
  1. 9 9
      BFRecordScreenKit/Classes/BFVoiceRecordManager.swift

+ 9 - 9
BFRecordScreenKit/Classes/BFVoiceRecordManager.swift

@@ -92,21 +92,21 @@ extension BFVoiceRecordManager: BFRecorderManagerDelegate{
        
             // 处理降噪
             let noiseFilePath = outfile.replacingOccurrences(of: ".wav", with: "_noise_\(1)_.wav")
-            BFLog(1, message: "降噪后地址:\(noiseFilePath)")
+            BFLog(1, message: "降噪后地址:\(noiseFilePath) 原地址:\(outfile)")
             NXNoiseReduction().denoise(outfile, outFile: noiseFilePath)
             if let model = voiceModel {
-                model.wavFilePath = noiseFilePath
+                model.wavFilePath = outfile
                 model.duration = "\(duration)"
                 endRecordHandle?(model, nil)
             }
   
-            // 删除录制的原文件
-            do {
-                try FileManager.default.removeItem(atPath: outfile)
-                print("Success to remove recorder file. \(outfile)")
-            } catch {
-                print("Failed to remove recorder file. \(outfile)")
-            }
+//            // 删除录制的原文件
+//            do {
+//                try FileManager.default.removeItem(atPath: outfile)
+//                print("Success to remove recorder file. \(outfile)")
+//            } catch {
+//                print("Failed to remove recorder file. \(outfile)")
+//            }
         }
     }