|
@@ -0,0 +1,79 @@
|
|
|
|
+package QuickVerifyCrap;
|
|
|
|
+
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.io.FileNotFoundException;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.RandomAccessFile;
|
|
|
|
+
|
|
|
|
+public class VPXSNDStriptease {
|
|
|
|
+ public static void main(String[] args) throws IOException {
|
|
|
|
+ File dir = new File("D:\\loa\\000028\\h4xxz0ring-addon\\moresamples-vpxtrack\\archive");
|
|
|
|
+ File[] files = dir.listFiles();
|
|
|
|
+ for (File f:files)
|
|
|
|
+ {
|
|
|
|
+ RandomAccessFile rf = new RandomAccessFile(f,"r");
|
|
|
|
+
|
|
|
|
+ String outsoxxedpath = f.getAbsoluteFile().getPath()+".wav";
|
|
|
|
+ String insoxxedpath = f.getAbsoluteFile().getPath()+".raw";
|
|
|
|
+ for(int i=0;i<3;i++)
|
|
|
|
+ {
|
|
|
|
+ int sizestr = getWiggledInt(rf);
|
|
|
|
+ System.out.println(sizestr);
|
|
|
|
+ byte[] lickme = new byte[sizestr];
|
|
|
|
+ rf.read(lickme);
|
|
|
|
+ }
|
|
|
|
+ byte[] stupidheader = new byte[18];
|
|
|
|
+ rf.read(stupidheader);
|
|
|
|
+ int realsize = getWiggledInt(rf);
|
|
|
|
+ System.out.println(realsize);
|
|
|
|
+ byte[] wavdata = new byte[realsize];
|
|
|
|
+ int rd = rf.read(wavdata);
|
|
|
|
+ System.out.println(rd);
|
|
|
|
+ rf.close();
|
|
|
|
+ //*
|
|
|
|
+ RandomAccessFile rfo = new RandomAccessFile(f.getAbsoluteFile().getPath()+".raw","rw");
|
|
|
|
+ rfo.write(wavdata);
|
|
|
|
+ rfo.close();
|
|
|
|
+ //*/
|
|
|
|
+
|
|
|
|
+ String[] soxme = new String[]
|
|
|
|
+ {
|
|
|
|
+ //sox -t raw -r 44100 -b 16 -c 1 -L -e signed-integer sound0.unhex.raw -r 44100 massiert3.wa
|
|
|
|
+ "sox","-t","raw","-r","44100","-b","16","-c","1","-L","-e","signed-integer",insoxxedpath,
|
|
|
|
+ outsoxxedpath
|
|
|
|
+ };
|
|
|
|
+ runToolx(dir,f.getName(),soxme);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static int getWiggledInt(RandomAccessFile rf) throws IOException {
|
|
|
|
+ byte[] eint = new byte[4];
|
|
|
|
+ rf.read(eint);
|
|
|
|
+ int[] refactoredBytes = new int[4];
|
|
|
|
+ refactoredBytes[0]=eint[0]&0xff;
|
|
|
|
+ refactoredBytes[1]=eint[1]<<8&0xff00;
|
|
|
|
+ refactoredBytes[2]=eint[2]<<16&0xff0000;
|
|
|
|
+ refactoredBytes[3]=eint[3]<<24;
|
|
|
|
+ return
|
|
|
|
+ refactoredBytes[0]|
|
|
|
|
+ refactoredBytes[1]|
|
|
|
|
+ refactoredBytes[2]|
|
|
|
|
+ refactoredBytes[3];
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void runToolx(File workdir, String F,String... args) throws IOException {
|
|
|
|
+ ProcessBuilder pb = new ProcessBuilder();
|
|
|
|
+ pb.command(args);
|
|
|
|
+ if (workdir != null && workdir.isDirectory()) {
|
|
|
|
+ pb.directory(workdir);
|
|
|
|
+ }
|
|
|
|
+ pb.redirectOutput(new File("D:\\loa\\000028\\h4xxz0ring-addon\\moresamples-vpxtrack\\Archive\\"+F+".txt"));
|
|
|
|
+ pb.redirectError(new File("D:\\loa\\000028\\h4xxz0ring-addon\\moresamples-vpxtrack\\Archive\\"+F+".e.txt"));
|
|
|
|
+ Process runme = pb.start();
|
|
|
|
+ try {
|
|
|
|
+ runme.waitFor();
|
|
|
|
+ } catch (InterruptedException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|