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(); | |
} | |
} | |
} |
Have you solved this issue?Because i am also facing the same problem.If u have resolved it then kindly help me how to solve it
Thanx
I also face the same problem,some people said because of permission
Hi have you resolved the problem, i'have the same error ! Thanks
Hi, What changes need to be made in order to convert .wav to .mp3 ? Tried doing that I am getting an error saying could not find codec parameters
hello @westlinkin did you find how to solve that error? i have the same!
Same issue with permission
4 years later, same issue
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm using it in Android, but some error happened.
Here is the logcat:
Can you tell me where I did wrong? Thanks in advance.