Update README

main
Nes370 2024-07-25 18:28:35 -07:00
parent 3095cd02b7
commit 50ca7a7d7e
2 changed files with 136 additions and 108 deletions

View File

@ -4,11 +4,17 @@
### Requirements ### Requirements
- *RR6AudioExtractor* requires that you have Java SE 17 or higher installed to run. - You must have Java SE 17 or higher installed to run *RR6AudioExtractor*.
- To install, download the latest JRE (recommended) or JDK from [Adoptium](https://adoptium.net/temurin/archive/?version=17), or JDK from [Oracle](https://www.oracle.com/java/technologies/downloads/#java17). - To install, download the latest JRE (recommended) or JDK from [Adoptium](https://adoptium.net/temurin/archive/?version=17), or JDK from [Oracle](https://www.oracle.com/java/technologies/downloads/#java17).
### Usage ### Usage
*RR6AudioExtractor* is a command-line application. To use it:
1. Open a Command-Line Interface (CLI)
2. Navigate to the directory containing `RR6AudioExtractor.jar`
3. Enter one of the following commands:
Launch console interface Launch console interface
``` ```
java -jar RR6AudioExtractor.java java -jar RR6AudioExtractor.java
@ -50,7 +56,6 @@ java -jar RR6AudioExtractor.java print <color> <text>
### Referenced Libraries ### Referenced Libraries
*RR6AudioExtractor* makes use of several Java libraries:
- [Apache Commons Codec](https://commons.apache.org/proper/commons-codec/) v1.17.1 - [Apache Commons Codec](https://commons.apache.org/proper/commons-codec/) v1.17.1
- [Apache Commons CSV](https://commons.apache.org/proper/commons-csv/) v1.11.0 - [Apache Commons CSV](https://commons.apache.org/proper/commons-csv/) v1.11.0
- [Apache Commons IO](https://commons.apache.org/proper/commons-io/) v2.16.1 - [Apache Commons IO](https://commons.apache.org/proper/commons-io/) v2.16.1
@ -61,4 +66,3 @@ java -jar RR6AudioExtractor.java print <color> <text>
- [*Xbox Image Browser*](https://digiex.net/threads/xbox-360-image-browser-2-9-0-350-xiso-browser-and-extractor.3136/) by Redline99 - [*Xbox Image Browser*](https://digiex.net/threads/xbox-360-image-browser-2-9-0-350-xiso-browser-and-extractor.3136/) by Redline99
- For extracting and replacing files from Xbox Disc Images (`ISO`). - For extracting and replacing files from Xbox Disc Images (`ISO`).

View File

@ -55,116 +55,140 @@ public class AudioExtractor {
*/ */
public static void main(String[] args) throws URISyntaxException, InterruptedException { public static void main(String[] args) throws URISyntaxException, InterruptedException {
// Print Audio Extractor logo if(args.length == 0) {
if(CMD_MODE) {
// NARROW LOGO // Print Audio Extractor logo
System.out.println(Ansi.colorize(logoFormat("Ridge", true, 8)/*.substring(0, 484) + adjustment*/, Attribute.BRIGHT_RED_TEXT())); if(CMD_MODE) {
Thread.sleep(500);
String adjustment = "█████████ ████████████████████████████████████████████████████ ████████████████████████"; // NARROW LOGO
System.out.println(ANSI_BACKLINE + ANSI_BACKLINE + Ansi.colorize(adjustment, Attribute.BRIGHT_RED_TEXT())); System.out.println(Ansi.colorize(logoFormat("Ridge", true, 8)/*.substring(0, 484) + adjustment*/, Attribute.BRIGHT_RED_TEXT()));
System.out.println(Ansi.colorize(logoFormat("Racer 6", true, 9), Attribute.BRIGHT_RED_TEXT())); Thread.sleep(500);
Thread.sleep(500);
System.out.println(Ansi.colorize(logoFormat("Audio", true, 8), Attribute.YELLOW_TEXT())); String adjustment = "█████████ ████████████████████████████████████████████████████ ████████████████████████";
Thread.sleep(500); System.out.println(ANSI_BACKLINE + ANSI_BACKLINE + Ansi.colorize(adjustment, Attribute.BRIGHT_RED_TEXT()));
System.out.println(Ansi.colorize(logoFormat("Racer 6", true, 9), Attribute.BRIGHT_RED_TEXT()));
Thread.sleep(500);
System.out.println(Ansi.colorize(logoFormat("Xtractr", true, 8), Attribute.YELLOW_TEXT())); System.out.println(Ansi.colorize(logoFormat("Audio", true, 8), Attribute.YELLOW_TEXT()));
Thread.sleep(500); Thread.sleep(500);
} else { System.out.println(Ansi.colorize(logoFormat("Xtractr", true, 8), Attribute.YELLOW_TEXT()));
Thread.sleep(500);
// WIDE LOGO } else {
System.out.println(Ansi.colorize(logoFormat("Ridge Racer 6"), Attribute.BRIGHT_RED_TEXT()));
Thread.sleep(500);
System.out.println(Ansi.colorize(logoFormat("Audio Extractor", true, 8), Attribute.YELLOW_TEXT())); // WIDE LOGO
Thread.sleep(500); System.out.println(Ansi.colorize(logoFormat("Ridge Racer 6"), Attribute.BRIGHT_RED_TEXT()));
Thread.sleep(500);
} System.out.println(Ansi.colorize(logoFormat("Audio Extractor", true, 8), Attribute.YELLOW_TEXT()));
Thread.sleep(500);
// Print meta info
System.out.println("Program:\tRidge Racer 6 Audio Extractor " + Ansi.colorize("v1.0", Attribute.BRIGHT_GREEN_TEXT()) + " by "
+ Ansi.colorize("Nes", Attribute.TEXT_COLOR(252, 42, 124)));
System.out.println("Repository:\t" + Ansi.colorize("https://gitea.goblincave.synology.me/Nes/RR6AudioExtractor", Attribute.CYAN_TEXT()));
System.out.println();
// Initialize user input reader
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true) {
// determine which operation to execute
String operationInput = null;
if(args.length > 0)
operationInput = args[0];
String operation = retrieveOperation(reader, operationInput);
if(args.length == 0) { // no arguments provided
switch(operation) {
case "identify": {
File unknownFile = retrieveFile(reader, "Please enter the path of a file: " + ANSI_BEIGE);
identify(unknownFile);
break;
}
case "extract": {
File packageFile = retrievePackage(reader);
if(packageFile.isFile())
extract(packageFile);
else { // packageFile is a folder
File[] packages = packageFile.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".bin");
}
});
for(File pack : packages) {
extract(pack);
}
}
break;
}
case "convert": {
File audioFile = retrieveAudio(reader); // Confirms file has WAV/XMA/FLAC extension + header
if(audioFile.isFile()) {
String extension = FilenameUtils.getExtension(audioFile.getName());
// Ensure file has the right encoding (differentiate between WAV/XMA)
int encoding = 0;
// RandomAccessFile raf = new RandomAccessFile(audioFile, "r");
// convert(audioFile, encoding);
}
}
case "package": {// pack
break;
}
case "patch": // patch
File waveFile = retrieveWave(reader);
patch(waveFile);
break;
case "print": // print
Attribute color = retrieveColor(reader);
String message = retrieveInput(reader, "Please enter your logo message: " + ANSI_BEIGE);
System.out.println(Ansi.colorize(logoFormat(message), color));
break;
case "exit": // exit
System.out.println("Program closed.");
System.exit(0);
break;
}
} }
System.out.println("Press Enter to continue..."); // Print meta info
try { reader.readLine(); } catch (Exception e) {} System.out.println("Program:\tRidge Racer 6 Audio Extractor " + Ansi.colorize("v1.0", Attribute.BRIGHT_GREEN_TEXT()) + " by "
+ Ansi.colorize("Nes", Attribute.TEXT_COLOR(252, 42, 124)));
System.out.println("Repository:\t" + Ansi.colorize("https://gitea.goblincave.synology.me/Nes/RR6AudioExtractor", Attribute.CYAN_TEXT()));
System.out.println();
// Initialize user input reader
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true) {
// determine which operation to execute
String operationInput = null;
if(args.length > 0)
operationInput = args[0];
String operation = retrieveOperation(reader, operationInput);
if(args.length == 0) { // no arguments provided
switch(operation) {
case "identify": {
File unknownFile = retrieveFile(reader, "Please enter the path of a file: " + ANSI_BEIGE);
identify(unknownFile);
break;
}
case "extract": {
File packageFile = retrievePackage(reader);
if(packageFile.isFile())
extract(packageFile);
else { // packageFile is a folder
File[] packages = packageFile.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".bin");
}
});
for(File pack : packages) {
extract(pack);
}
}
break;
}
case "convert": {
File audioFile = retrieveAudio(reader); // Confirms file has WAV/XMA/FLAC extension + header
// if(audioFile.isFile()) {
// String extension = FilenameUtils.getExtension(audioFile.getName());
// // Ensure file has the right encoding (differentiate between WAV/XMA)
// int encoding = 0;
// RandomAccessFile raf;
// try {
// raf = new RandomAccessFile(audioFile, "r");
// raf.seek(0x0);
// raf.readInt();
// } catch (FileNotFoundException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
convert(audioFile, extension);
}
}
case "package": {// pack
break;
}
case "patch": // patch
File waveFile = retrieveWave(reader);
patch(waveFile);
break;
case "print": // print
Attribute color = retrieveColor(reader);
String message = retrieveInput(reader, "Please enter your logo message: " + ANSI_BEIGE);
System.out.println(Ansi.colorize(logoFormat(message), color));
break;
case "exit": // exit
System.out.println("Program closed.");
System.exit(0);
break;
}
}
System.out.println("Press Enter to continue...");
try { reader.readLine(); } catch (Exception e) {}
}
} }
}
/**
* Converts an audio file to the target format.
*
* @param audioFile
* @param format
*/
private static void convert(File audioFile, String format) {
} }
/** /**