////将音频保存在缓存中

////将音频保存在缓存中

//func saveAudioCache(_ data:Data){

//

//let documentPaths = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.cachesDirectory,

//FileManager.SearchPathDomainMask.userDomainMask, true)

//let documnetPath = documentPaths[0] as! String+"/audio"

//

//print(documnetPath)

//do {

//if FileManager().fileExists(atPath: documnetPath){

//try FileManager().createDirectory(atPath: "\(documnetPath)", withIntermediateDirectories: true, attributes: nil)

//

//}

//let filePath=documnetPath+self.keyHash!

//try? data.write(to: URL(fileURLWithPath: filePath))

//}catch let err {

//

//debugPrint(err)

//

//}

//}

你可能感兴趣的:(////将音频保存在缓存中)