Created
May 27, 2013 20:22
-
-
Save Michcioperz/5658906 to your computer and use it in GitHub Desktop.
Simple music converting Java thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
public class Musiconvert { | |
public static void main(String[] args) { | |
String ffmpeguri = "J:\\droidqemu\\FFMPEG\\ffmpeg.exe"; //path to FFmpeg goes here | |
String targetcodec = "libmp3lame"; //target codec goes here | |
String targetextension = ".mp3"; //target file extension goes here | |
String[] uris = new String[] { | |
/* source files paths go here */ | |
}; | |
for (String uri: uris) { | |
try { | |
Process process = new ProcessBuilder(ffmpeguri, "-i", uri, "-acodec", targetcodec, uri + targetextension).start(); | |
} catch (IOException ioe) { | |
ioe.printStackTrace(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment