package Ming;

import net.bramp.ffmpeg.FFmpeg;
import net.bramp.ffmpeg.FFmpegExecutor;
import net.bramp.ffmpeg.FFprobe;
import net.bramp.ffmpeg.builder.FFmpegBuilder;

import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

public class AudioExtractor {
    private final String outputAudioFormat = "wav";
    private FFmpegExecutor m_executor;
    private String m_inputFilepath;
    AudioExtractor() throws IOException{
        m_executor = new FFmpegExecutor(new FFmpeg("ffmpeg"), new FFprobe("ffprobe"));
    }
    AudioExtractor(String inputFilepath) throws IOException {
        this();
        setInput(inputFilepath);
    }
    public void setInput(String inputFilepath) {
        m_inputFilepath = inputFilepath;
    }
    public String extract(long startOffset, long duration) throws IOException {
        String output = File.createTempFile(startOffset + "_" + duration, "." + outputAudioFormat).getAbsolutePath();

        m_executor.createJob(new FFmpegBuilder()
                .setInput(m_inputFilepath)
                .overrideOutputFiles(true)
                .addOutput(output)
                .setFormat(outputAudioFormat)
                .setStartOffset(startOffset, TimeUnit.MILLISECONDS)
                .setDuration(duration, TimeUnit.MILLISECONDS)
                .done()
        ).run();

        return output;
    }
}

@@ -329,11 +329,11 @@
  = %22
-wav
+ogg
 %22;%0A 
@@ -1143,165 +1143,110 @@
    .
-setFormat(outputAudioFormat)%0A                .setStartOffset(startOffset, TimeUnit.MILLISECONDS)%0A                .setDuration(duration, TimeUnit.MILLISECONDS
+disableVideo()%0A                .setFormat(outputAudioFormat)%0A                .setAudioSampleRate(16000
 )%0A  

Change AudioExtractor output from wav to ogg