|
@@ -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)")
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
|