1
0
mirror of synced 2024-11-30 14:14:29 +01:00
TaikoSoundEditor/IDSP.cs

40 lines
1.2 KiB
C#
Raw Normal View History

2023-07-17 10:20:00 +02:00
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TaikoSoundEditor
{
internal static class IDSP
{
public static void WavToIdsp(string source, string dest)
{
2023-07-19 07:10:25 +02:00
Logger.Info("Converting WAV to IDSP");
2023-07-17 10:20:00 +02:00
source = Path.GetFullPath(source);
dest = Path.GetFullPath(dest);
2023-07-19 07:10:25 +02:00
Logger.Info($"source = {source}");
Logger.Info($"dest = {dest}");
2023-07-17 10:20:00 +02:00
var p = new Process();
p.StartInfo.FileName = Path.GetFullPath(@"Tools\VGAudio\VGAudioCli.exe");
p.StartInfo.ArgumentList.Add(source);
p.StartInfo.ArgumentList.Add(dest);
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = false;
p.Start();
p.WaitForExit();
int exitCode = p.ExitCode;
string stderr = p.StandardError.ReadToEnd();
if (exitCode != 0)
throw new Exception($"Process VGAudioCli failed with exit code {exitCode}:\n" + stderr);
}
}
}