From fdf561473d72f238bb643096ea0925130bf5ba72 Mon Sep 17 00:00:00 2001
From: 无故事王国 <841720330@qq.com>
Date: 星期四, 25 七月 2024 14:42:05 +0800
Subject: [PATCH] fix bug

---
 DolphinEnglishLearnStudent/Config/VoicePlayer.swift |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/DolphinEnglishLearnStudent/Config/VoicePlayer.swift b/DolphinEnglishLearnStudent/Config/VoicePlayer.swift
index 63a8a8a..9b1f888 100644
--- a/DolphinEnglishLearnStudent/Config/VoicePlayer.swift
+++ b/DolphinEnglishLearnStudent/Config/VoicePlayer.swift
@@ -71,7 +71,7 @@
 																								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 {
@@ -126,6 +126,11 @@
 								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()

--
Gitblit v1.7.1