-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
67 lines (64 loc) · 2.3 KB
/
Program.cs
File metadata and controls
67 lines (64 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HadesAudioHelper
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This is generating the VO.h.");
Header();
Console.ReadLine();
}
/***
* Allows to generate VO.h using Fmod Bank Tools.zip-2-0-0-1-4-1565765483 Generated VO.txt
* Directory for VO.txt to become a VO.h
*/
public static void Header()
{
string[] lines = System.IO.File.ReadAllLines(@"C:\HadesModding\Fmod Bank Tools.zip-2-0-0-1-4-1565765483\wav\VO\VO.txt");
string[] results = new string[lines.Count() + 6];
Console.WriteLine("Finish {0} Audio.",lines.Count());
int index = 0;
results[0] = "#ifndef _VO_H";
results[1] = "#define _VO_H";
results[2] = "";
foreach (var line in lines)
{
results[index + 3] = "#define " + line.ToUpper().Substring(0, line.Length - 4) + " " + index;
index++;
}
results[index + 3] = "";
results[index + 4] = "#endif";
results[index + 5] = "";
string path = @"E:\Games\Hades\AudioTest\Fmod Bank Tools.zip-2-0-0-1-4-1565765483\VO.h";
if (!File.Exists(path))
{
File.Delete(path);
}
File.WriteAllLines(path, results);
}
/***
* Allows to rename all audio from Vo-****.ogg to ****.ogg
* Directory to change for all the Audio you extracted to rename them like the original.
*/
public static void Renamer()
{
string filepath = @"C:\HadesModding\python-fsb5_win64\python-fsb5\out\";
DirectoryInfo d = new DirectoryInfo(filepath);
foreach (var file in d.GetFiles("*.ogg"))
{
if (file.Name.StartsWith("VO-"))
{
var newName = file.Name.Substring(3);
Console.WriteLine(file.DirectoryName + "\\" + newName);
Directory.Move(file.FullName, file.DirectoryName + "\\" + newName);
}
}
}
}
}