| | |
| | | do { |
| | | let finalCacheUrl = self.voiceCacheDirectory.appendingPathComponent(URL(fileURLWithPath: u).lastPathComponent) |
| | | try FileManager.default.moveItem(at: tempLocalUrl, to: finalCacheUrl) |
| | | self.player = try? AVAudioPlayer(contentsOf: finalCacheUrl) |
| | | self.player = try? AVAudioPlayer(contentsOf: finalCacheUrl.droppedScheme()!) |
| | | self.player?.delegate = self |
| | | self.player?.play() |
| | | DispatchQueue.main.async { |
| | |
| | | tempPlayer?.play() |
| | | } |
| | | |
| | | static func hasPromoteVoice()->Bool{ |
| | | let list = try? FileManager.default.contentsOfDirectory(atPath: VoicePlayer.share().voiceCacheDirectory.droppedScheme()!.absoluteString) |
| | | return list?.contains(["SuccessPromote","FailPromote"]) ?? false |
| | | } |
| | | |
| | | func donwloadPromoteVoice(successVoice:String,failVoice:String,updateTime:String){ |
| | | print("-->\(VoicePlayer.share().voiceCacheDirectory)") |
| | | let group = DispatchGroup() |