浏览代码

关闭降噪方法

jsonwang 3 年之前
父节点
当前提交
51436ccc69
共有 1 个文件被更改,包括 9 次插入9 次删除
  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)")
+//            }
         }
     }