From 38d59e2f72b81d9a9ce0571891be0e0f149044b4 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Mon, 4 Dec 2023 15:52:20 -0500 Subject: [PATCH] don't double-embed the converted audio --- Assets/Scripts/Minigames.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index c83399a81..5e4f4af1b 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -146,6 +146,10 @@ namespace HeavenStudio public static string JukeboxAudioConverter(string filePath, AudioType audioType, string specificType) { + if (Directory.Exists(Path.Combine(Application.temporaryCachePath, "/savewav"))) + { + Directory.Delete(Path.Combine(Application.temporaryCachePath, "/savewav"), true); + } if (audioType == AudioType.MPEG) { Debug.Log($"mp3 loaded, Converting {filePath} to wav..."); @@ -163,8 +167,8 @@ namespace HeavenStudio } AudioClip clip = DownloadHandlerAudioClip.GetContent(www); string fileName = Path.GetFileNameWithoutExtension(filePath); - SavWav.Save("/RIQCache/" + fileName, clip, true); - filePath = Path.Combine(Application.temporaryCachePath, "/RIQCache/" + fileName + ".wav"); + SavWav.Save("/savewav/" + fileName, clip, true); + filePath = Path.Combine(Application.temporaryCachePath, "/savewav/" + fileName + ".wav"); clip = null; }