Here you can find the source of writeAudio(String source, String writePath)
static Process writeAudio(String source, String writePath)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Paths; public class Main { private static final String WRITER_PATH = Paths .get("audio/controller/AudioWriter.exe").toAbsolutePath() .toString(); static Process writeAudio(String source, String writePath) { String command = "\"" + WRITER_PATH + "\" \"" + source + "\" " + writePath + ""; Process process = null;//from w w w. j ava 2 s .c o m try { process = Runtime.getRuntime().exec(command); printErrorStream(process); } catch (IOException e) { e.printStackTrace(); } return process; } private static void printErrorStream(final Process process) { if (process != null) { new Thread(new Runnable() { @Override public void run() { try (BufferedReader stdError = new BufferedReader( new InputStreamReader(process.getErrorStream()))) { String error = null; while ((error = stdError.readLine()) != null) { System.err.println(error); Thread.sleep(200); } } catch (Exception e) { e.printStackTrace(); } } }).start(); } } }