update jlibloader dependency in maven artifact to 0.3
This commit is contained in:
@@ -11,14 +11,14 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.github.boukefalos:jlibloader:0.2'
|
compile 'com.github.boukefalos:jlibloader:0.3'
|
||||||
compile 'org.slf4j:slf4j-api:1.7.8'
|
compile 'org.slf4j:slf4j-api:1.7.8'
|
||||||
testCompile 'junit:junit:4.8.2'
|
testCompile 'junit:junit:4.8.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'com.github.boukefalos'
|
group = 'com.github.boukefalos'
|
||||||
project.archivesBaseName = 'jlibsox'
|
project.archivesBaseName = 'jlibsox'
|
||||||
version = '0.1'
|
version = '0.2'
|
||||||
def jniVersion = '14.4.1'
|
def jniVersion = '14.4.1'
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
task wrapper(type: Wrapper) {
|
||||||
@@ -122,7 +122,7 @@ mainPom.withXml { provider ->
|
|||||||
def dep = deps.appendNode('dependency')
|
def dep = deps.appendNode('dependency')
|
||||||
dep.appendNode('groupId', 'com.github.boukefalos')
|
dep.appendNode('groupId', 'com.github.boukefalos')
|
||||||
dep.appendNode('artifactId', 'jlibloader')
|
dep.appendNode('artifactId', 'jlibloader')
|
||||||
dep.appendNode('version', '0.2')
|
dep.appendNode('version', '0.3')
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
|||||||
@@ -1,18 +1,25 @@
|
|||||||
package ie.corballis.sox;
|
package ie.corballis.sox;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import java.io.BufferedReader;
|
||||||
import org.slf4j.LoggerFactory;
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.*;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.github.boukefalos.jlibloader.Native;
|
||||||
|
|
||||||
public class Sox {
|
public class Sox {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(Sox.class);
|
private static Logger logger = LoggerFactory.getLogger(Sox.class);
|
||||||
|
|
||||||
private final String soXBinaryPath;
|
private static String soXBinaryPath;
|
||||||
|
|
||||||
|
private String device;
|
||||||
|
|
||||||
private List<String> arguments = new ArrayList<String>();
|
private List<String> arguments = new ArrayList<String>();
|
||||||
|
|
||||||
@@ -26,10 +33,19 @@ public class Sox {
|
|||||||
|
|
||||||
private boolean hasBeenExecuted = false;
|
private boolean hasBeenExecuted = false;
|
||||||
|
|
||||||
|
public Sox() {
|
||||||
|
soXBinaryPath = Native.binary("com.github.boukefalos", "jlibsox", "sox");
|
||||||
|
}
|
||||||
|
|
||||||
public Sox(String soxPath) {
|
public Sox(String soxPath) {
|
||||||
this.soXBinaryPath = soxPath;
|
this.soXBinaryPath = soxPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Sox device(String device) {
|
||||||
|
this.device = device;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Sox ignoreLength() {
|
public Sox ignoreLength() {
|
||||||
arguments.add("--ignore-length");
|
arguments.add("--ignore-length");
|
||||||
formatOptionSet = true;
|
formatOptionSet = true;
|
||||||
@@ -72,7 +88,7 @@ public class Sox {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// global options
|
// global options
|
||||||
public Sox verbose(Integer level) {
|
public Sox verbose(Integer level) {
|
||||||
arguments.add("-V" + level.toString());
|
arguments.add("-V" + level.toString());
|
||||||
globalOptionSet = true;
|
globalOptionSet = true;
|
||||||
@@ -117,6 +133,9 @@ public class Sox {
|
|||||||
arguments.add(0, soXBinaryPath);
|
arguments.add(0, soXBinaryPath);
|
||||||
logger.debug("Sox arguments: {}", arguments);
|
logger.debug("Sox arguments: {}", arguments);
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder(arguments);
|
ProcessBuilder processBuilder = new ProcessBuilder(arguments);
|
||||||
|
if (device != null) {
|
||||||
|
processBuilder.environment().put("AUDIODEV", device);
|
||||||
|
}
|
||||||
processBuilder.redirectErrorStream(true);
|
processBuilder.redirectErrorStream(true);
|
||||||
Process process = null;
|
Process process = null;
|
||||||
IOException errorDuringExecution = null;
|
IOException errorDuringExecution = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user