Make intermediate filenames unique so there are no same-name audio
conflicts.
This commit is contained in:
parent
fd6642805a
commit
fe43fa7b11
Binary file not shown.
@ -188,7 +188,7 @@ BeatmapSetID:-1
|
||||
split[2] = Integer.toString(Integer.parseInt(split[2])+(int)timePoint);
|
||||
if (split.length>=6) {
|
||||
//Might be a spinner.
|
||||
if (!split[5].contains("|")) {
|
||||
if (!split[5].contains("|") && !split[5].contains(":")) {
|
||||
//This is a spinner.
|
||||
split[5] = Integer.toString(Integer.parseInt(split[5])+(int)timePoint);
|
||||
} else {
|
||||
@ -257,7 +257,7 @@ BeatmapSetID:-1
|
||||
fw2 = new FileWriter(f);
|
||||
BufferedWriter bw2 = new BufferedWriter(fw2);
|
||||
for (int i=0;i<maps.size();i++) {
|
||||
File filer = new File(maps.get(i).songLoc.getName().replace(".mp3", "_A.mp3"));
|
||||
File filer = new File(maps.get(i).songTitle.replace(".osu", ".mp3"));
|
||||
bw2.write("file '"+filer.getAbsolutePath().replace("'", "'\\''")+"'\n");
|
||||
}
|
||||
bw2.close();
|
||||
|
@ -43,10 +43,10 @@ public class ListItem{
|
||||
songLoc = new File(f.getParent()+File.separatorChar+line.replace(targetString, ""));
|
||||
System.out.println("SongLoc: "+songLoc);
|
||||
|
||||
File filer = new File(songLoc.getName().replace(".mp3", "_A.mp3"));
|
||||
File filer = new File(songTitle.replace(".osu", ".mp3"));
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
|
||||
String command = "ffmpeg -i \""+songLoc.getAbsolutePath()+"\" -f mp3 -b:a 128k -ar 44100 -ac 2 \""+songLoc.getName().replace(".mp3", "_A.mp3")+"\"";
|
||||
String command = "ffmpeg -i \""+songLoc.getAbsolutePath()+"\" -f mp3 -b:a 128k -ar 44100 -ac 2 \""+songTitle.replace(".osu", ".mp3")+"\"";
|
||||
CommandLine cmdLine = CommandLine.parse(command);
|
||||
DefaultExecutor exec = new DefaultExecutor();
|
||||
exec.setStreamHandler(streamHandler);
|
||||
|
Loading…
x
Reference in New Issue
Block a user