public static void Wav2Wem(string wwiseCLIPath, string wwiseTemplateDir) { var templatePath = Path.Combine(wwiseTemplateDir, "Template.wproj"); var cmdArgs = String.Format(" \"{0}\" -GenerateSoundBanks", templatePath); GeneralExtensions.RunExternalExecutable(wwiseCLIPath, true, false, true, cmdArgs); }
public static void Song2014ToGp5(string inputPath, string outputDir, string outputFormat = null, string songDiff = null, string songId = null, string songArr = null, string songSplit = null) { if (outputFormat != null) { outputFormat = String.Format(" -f \"{0}\"", outputFormat); } if (songDiff != null) { songDiff = String.Format(" -d {0}", songDiff); } if (songId != null) { songId = String.Format(" -s \"{0}\"", songId); } if (songArr != null) { songArr = String.Format(" -a \"{0}\"", songArr); } if (songSplit != null) { songSplit = String.Format(" -t"); } var cmdArgs = String.Format(" \"{0}\" -o \"{1}\"{2}{3}{4}{5}{6}", inputPath, outputDir, outputFormat, songDiff, songId, songArr, songSplit).TrimEnd(); GeneralExtensions.RunExternalExecutable(APP_GP5, true, false, true, cmdArgs); }
public static void Wav2Wem(string wwiseCliPath) { var appRootDir = Path.GetDirectoryName(Application.ExecutablePath); var templateDir = "Wwise\\Template"; var templatePath = Path.Combine(appRootDir, templateDir, "Template.wproj"); var cmdArgs = String.Format(" \"{0}\" -GenerateSoundBanks", templatePath); GeneralExtensions.RunExternalExecutable(wwiseCliPath, true, false, true, cmdArgs); }
public static void Wav2Wem(string wwiseCLIPath, string wwiseTemplateDir) { var templatePath = Path.Combine(wwiseTemplateDir, "Template.wproj"); // -NoWwiseDat ignores cached wem's and will generate each time. // -ClearAudioFileCache force re-generate for wem's also deletes old and creates fresh new file. // -Save should help with updating project to new schema (may loose quality factor field) var cmdArgs = String.Format(" \"{0}\" -GenerateSoundBanks -Platform Windows -Language English(US) -NoWwiseDat -ClearAudioFileCache -Save", templatePath); GeneralExtensions.RunExternalExecutable(wwiseCLIPath, true, false, true, cmdArgs); }
public static void Wav2Ogg(string sourcePath, string destinationPath, int qualityFactor) { if (destinationPath == null) { destinationPath = String.Format("{0}", Path.ChangeExtension(sourcePath, "ogg")); } // interestingly ODLC uses 44100 or 48000 interchangeably ... so resampling is not necessary var cmdArgs = String.Format(" -q {2} \"{0}\" -o \"{1}\"", sourcePath, destinationPath, Convert.ToString(qualityFactor)); GeneralExtensions.RunExternalExecutable(APP_OGGENC, true, false, true, cmdArgs); }
public static void Wav2Ogg(string sourcePath, string destinationPath, int qualityFactor) { if (destinationPath == null) { destinationPath = String.Format("{0}", Path.ChangeExtension(sourcePath, "ogg")); } var cmdArgs = String.Format(" -r -q {2} -R 48000 \"{0}\" -o \"{1}\"", sourcePath, destinationPath, Convert.ToString(qualityFactor)); GeneralExtensions.RunExternalExecutable(APP_OGGENC, true, false, true, cmdArgs); }
public static void Preview2Wav(string sourcePath) { var dirName = Path.GetDirectoryName(sourcePath); var fileName = Path.GetFileNameWithoutExtension(sourcePath); var dirFileName = Path.Combine(dirName, fileName); var srcPath = String.Format("{0}_{1}.ogg", dirFileName, "preview"); var destPath = Path.ChangeExtension(srcPath, ".wav"); var cmdArgs = String.Format(" -o \"{1}\" \"{0}\"", srcPath, destPath); GeneralExtensions.RunExternalExecutable(APP_OGGDEC, true, false, true, cmdArgs); }
public static void Dds2Png(string sourcePath, string destinationPath = null) { var cmdArgs = String.Empty; if (destinationPath == null) { cmdArgs = String.Format(" -overwrite -out png \"{0}\"", sourcePath); } else { cmdArgs = String.Format(" -overwrite -out png -o \"{1}\" \"{0}\"", sourcePath, destinationPath); } GeneralExtensions.RunExternalExecutable(APP_TOPNG, true, true, true, cmdArgs); }
/// <summary> /// Convert audio file to ogg /// </summary> /// <param name="sourcePath"> RAW Audio, WAV, AIFF, FLAC, OGG</param> /// <param name="destinationPath">OGG</param> /// <param name="qualityFactor"> 0 (low) to 10 (high)</param> /// <param name="sampleRate"> (Hz), defaults to same sample rate as source if not specified</param> public static void Audio2Ogg(string sourcePath, string destinationPath, int qualityFactor, int sampleRate = 0) { if (destinationPath == null) { destinationPath = String.Format("{0}", Path.ChangeExtension(sourcePath, "ogg")); } var cmdArgs = String.Format(" -q {2} \"{0}\" -o \"{1}\"", sourcePath, destinationPath, qualityFactor); if (sampleRate > 0) { cmdArgs += String.Format(" --resample {0}\"", sampleRate); } GeneralExtensions.RunExternalExecutable(APP_OGGENC, true, false, true, cmdArgs); }
public static void InjectZip(string sourcePath, string destinationPath, bool recurseDir = false, bool filesOnly = false) { var cmdSwitch = String.Empty; if (recurseDir) { cmdSwitch = " -r"; // do not remove space } if (filesOnly) { sourcePath = Path.Combine(sourcePath, "*"); } // CRITICAL spacing in cmdArgs var cmdArgs = String.Format(" a \"{0}\"{2} \"{1}\"", destinationPath, sourcePath, cmdSwitch); GeneralExtensions.RunExternalExecutable(APP_7Z, true, true, true, cmdArgs); }
public static void Wav2Wem(string wwiseCLIPath, string wwiseTemplateDir, int magicDust = 0) { var templatePath = Path.Combine(wwiseTemplateDir, "Template.wproj"); // -NoWwiseDat ignores cached wem's and will generate each time. // -ClearAudioFileCache force re-generate for wem's also deletes old and creates fresh new file. // -Save should help with updating project to new schema (may loose quality factor field) var cmdArgs = String.Format("\"{0}\" -GenerateSoundBanks -Platform Windows -Language English(US) -NoWwiseDat -ClearAudioFileCache -Save", templatePath); var output = GeneralExtensions.RunExternalExecutable(wwiseCLIPath, true, false, true, cmdArgs); if (output.Contains("Error: Project migration needed") && magicDust > 0) { Debug.WriteLine("WwiseCLI.exe Conversion Failed ..."); Debug.WriteLine("Applying Magic Dust #" + magicDust); magicDust--; Wav2Wem(wwiseCLIPath, wwiseTemplateDir, magicDust); } }
public static void ExtractZip(string sourcePath, string destinationPath, bool overwriteExisting = true, bool runInBackground = true) { var cmdSwitch = String.Empty; if (overwriteExisting) { cmdSwitch = " -aoa"; } // CRITICAL spacing in cmdArgs ... there can be no space after "-o" or it doesn't work var cmdArgs = String.Format(" x \"{0}\"{2} -o\"{1}\"", sourcePath, destinationPath, cmdSwitch); if (runInBackground) { GeneralExtensions.RunExternalExecutable(APP_7Z, true, true, true, cmdArgs); } else { GeneralExtensions.RunExternalExecutable(APP_7Z, true, false, true, cmdArgs); } }
//TODO:faster to use dircet lib calls?? If this works lib calls will too. public static void RepackPsarc(string sourcePath, string destinationPath, string targetPlatform) { var cmdArgs = String.Format(" --pack --input=\"{0}\" --platform={2} --version=RS2014 --output=\"{1}\"", sourcePath, destinationPath, targetPlatform); GeneralExtensions.RunExternalExecutable(APP_PACKER, true, true, true, cmdArgs); }
public static void Png2Dds(string sourcePath, string destinationPath, int xSize, int ySize) { var cmdArgs = String.Format(" -file \"{0}\" -prescale {2} {3} -quality_highest -max -dxt5 -nomipmap -alpha -overwrite -output \"{1}\"", sourcePath, destinationPath, xSize, ySize); GeneralExtensions.RunExternalExecutable(APP_NVDXT, true, true, true, cmdArgs); }
public static void PngFlipY(string sourcePath) { var cmdArgs = String.Format("-overwrite -yflip \"{0}\"", sourcePath); GeneralExtensions.RunExternalExecutable(APP_TOPNG, true, true, true, cmdArgs); }
public static void Ogg2Wav(string sourcePath, string destinationPath) { var cmdArgs = String.Format(" -o \"{1}\" \"{0}\"", sourcePath, destinationPath); GeneralExtensions.RunExternalExecutable(APP_OGGDEC, true, false, true, cmdArgs); }
public static void Ogg2Preview(string sourcePath, string destinationPath, long msLength = 30000, long msStart = 4000) { var cmdArgs = String.Format(" -s {2} -l {3} \"{0}\" \"{1}\"", sourcePath, destinationPath, msStart, msLength); GeneralExtensions.RunExternalExecutable(APP_OGGCUT, true, false, true, cmdArgs); }
public static void UnpackPsarc(string sourcePath, string destinationPath, string targetPlatform) { var cmdArgs = String.Format(" --unpack --input=\"{0}\" --platform={2} --version=RS2014 --output=\"{1}\"", sourcePath, destinationPath, targetPlatform); GeneralExtensions.RunExternalExecutable(Path.Combine(TOOLKIT_ROOT, "packer.exe"), true, true, true, cmdArgs); }