Package it.sauronsoftware.jave

Examples of it.sauronsoftware.jave.AudioAttributes


            }
            logger.info("midi2wav conversion took: " + (System.currentTimeMillis() - start) + " millis");
            start = System.currentTimeMillis();
            EncodingAttributes attrs = new EncodingAttributes();
            attrs.setFormat("mp3");
            AudioAttributes audio = new AudioAttributes();
//            audio.setBitRate(36000);
//            audio.setSamplingRate(20000);
            attrs.setAudioAttributes(audio);
            attrs.setThreads(1);
            File mp3 = File.createTempFile("gen", ".mp3");
View Full Code Here


 
  static void copyFileToMP3(File source) throws IllegalArgumentException, InputFormatException, EncoderException{
    File target = new File(getDirByExtension("mp3"), changeExtension(getRelativePath(source), ".mp3"));
    if (target.exists()) return;
   
    AudioAttributes audio = new AudioAttributes();
    audio.setCodec("libmp3lame");
    audio.setBitRate(new Integer(64000));
    audio.setChannels(new Integer(2));
    audio.setSamplingRate(new Integer(22050));
   
    EncodingAttributes attrs = new EncodingAttributes();
    attrs.setFormat("mp3");
    attrs.setAudioAttributes(audio);
   
View Full Code Here

 
  static void copyFileToOgg(File source) throws IllegalArgumentException, InputFormatException, EncoderException{
    File target = new File(getDirByExtension("ogg"), changeExtension(getRelativePath(source), ".ogg"));
    if (target.exists()) return;
   
    AudioAttributes audio = new AudioAttributes();
    audio.setCodec("libvorbis");
    audio.setBitRate(new Integer(64000));
    audio.setChannels(new Integer(2));
    audio.setSamplingRate(new Integer(22050));
   
    EncodingAttributes attrs = new EncodingAttributes();
    attrs.setFormat("ogg");
    attrs.setAudioAttributes(audio);
   
View Full Code Here

  }
 
  static void copyFileToWav(File source) throws IllegalArgumentException, InputFormatException, EncoderException{
    File target = new File(getDirByExtension("wav"), changeExtension(getRelativePath(source), ".wav"));
    if (target.exists()) return;
    AudioAttributes audio = new AudioAttributes();
    audio.setCodec("pcm_s16le");
    audio.setBitRate(new Integer(128000));
    audio.setChannels(new Integer(2));
    audio.setSamplingRate(new Integer(44100));
    EncodingAttributes attrs = new EncodingAttributes();
    attrs.setFormat("wav");
    attrs.setAudioAttributes(audio);
    Encoder encoder = new Encoder(new Myffmpeg());
    encoder.encode(source, target, attrs);
View Full Code Here

TOP

Related Classes of it.sauronsoftware.jave.AudioAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.