Created
November 1, 2013 06:37
-
-
Save ChangJoo-Park/7261658 to your computer and use it in GitHub Desktop.
Using JAVE(Java Audio Video Encoder) example add external library jave 1.0.2 version
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
package jave_example; | |
import it.sauronsoftware.jave.AudioAttributes; | |
import it.sauronsoftware.jave.Encoder; | |
import it.sauronsoftware.jave.EncoderException; | |
import it.sauronsoftware.jave.EncodingAttributes; | |
import it.sauronsoftware.jave.InputFormatException; | |
import java.io.File; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
File source = new File("1.mp4"); | |
File target = new File("target.mp3"); | |
AudioAttributes audio = new AudioAttributes(); | |
audio.setCodec("libmp3lame"); | |
audio.setBitRate(new Integer(128000)); | |
audio.setChannels(new Integer(2)); | |
audio.setSamplingRate(new Integer(44100)); | |
EncodingAttributes attrs = new EncodingAttributes(); | |
attrs.setFormat("mp3"); | |
attrs.setAudioAttributes(audio); | |
Encoder encoder = new Encoder(); | |
try { | |
encoder.encode(source, target, attrs); | |
} catch (IllegalArgumentException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} catch (InputFormatException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} catch (EncoderException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
4 years later, same issue