mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-04-30 00:14:25 +02:00
don't put separator chars here
This commit is contained in:
parent
cad154423e
commit
71d610c09b
@ -151,7 +151,7 @@ namespace HeavenStudio
|
|||||||
|
|
||||||
public static string JukeboxAudioConverter(string filePath, AudioType audioType, string specificType)
|
public static string JukeboxAudioConverter(string filePath, AudioType audioType, string specificType)
|
||||||
{
|
{
|
||||||
string wavCachePath = Path.Combine(Application.temporaryCachePath, "/savewav");
|
string wavCachePath = Path.Combine(Application.temporaryCachePath, "savewav");
|
||||||
if (Directory.Exists(wavCachePath))
|
if (Directory.Exists(wavCachePath))
|
||||||
{
|
{
|
||||||
Directory.Delete(wavCachePath, true);
|
Directory.Delete(wavCachePath, true);
|
||||||
@ -177,8 +177,8 @@ namespace HeavenStudio
|
|||||||
}
|
}
|
||||||
AudioClip clip = DownloadHandlerAudioClip.GetContent(www);
|
AudioClip clip = DownloadHandlerAudioClip.GetContent(www);
|
||||||
string fileName = Path.GetFileNameWithoutExtension(filePath);
|
string fileName = Path.GetFileNameWithoutExtension(filePath);
|
||||||
SavWav.Save("/savewav/" + fileName, clip, true);
|
SavWav.Save(fileName, clip, true);
|
||||||
filePath = Path.Combine(wavCachePath, $"/{fileName}.wav");
|
filePath = Path.Combine(wavCachePath, $"{fileName}.wav");
|
||||||
|
|
||||||
clip = null;
|
clip = null;
|
||||||
}
|
}
|
||||||
|
@ -49,17 +49,18 @@ public static class SavWav
|
|||||||
|
|
||||||
public static void Save(string filename, AudioClip clip, bool trim = false)
|
public static void Save(string filename, AudioClip clip, bool trim = false)
|
||||||
{
|
{
|
||||||
|
string wavCachePath = Path.Combine(Application.temporaryCachePath, "savewav");
|
||||||
if (!filename.ToLower().EndsWith(".wav"))
|
if (!filename.ToLower().EndsWith(".wav"))
|
||||||
{
|
{
|
||||||
filename += ".wav";
|
filename += ".wav";
|
||||||
}
|
}
|
||||||
|
|
||||||
var filepath = Path.Combine(Application.temporaryCachePath, filename);
|
var filepath = Path.Combine(wavCachePath, filename);
|
||||||
|
|
||||||
// Make sure directory exists if user is saving to sub dir.
|
// Make sure directory exists if user is saving to sub dir.
|
||||||
if (!Directory.Exists(Path.GetDirectoryName(filepath)))
|
if (!Directory.Exists(Path.GetDirectoryName(wavCachePath)))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(filepath));
|
Directory.CreateDirectory(Path.GetDirectoryName(wavCachePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var fileStream = new FileStream(filepath, FileMode.Create))
|
using (var fileStream = new FileStream(filepath, FileMode.Create))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user