我在使用Lang.exec执行命令行命令时卡死了,我把命令复制出来到控制台运行可以直接跑完,不知为什么就卡死了.
String cmd="cmd.exe /c F:\\zhuanma\\silk_v3_decoder.exe "+silk+" "+pcm;
try
{
Lang.execOutput(cmd, Encoding.CHARSET_GBK);
}
C:\Windows\system32>F:\zhuanma\silk_v3_decoder.exe F:\zhuanma\vg2ub41omgipvrmur1fnssd3tq.silk F:\zhuanma\a.pcm
********** Silk Decoder (Fixed Point) v 1.0.9.6 ********************
********** Compiled for 32 bit cpu *******************************
Input: F:\zhuanma\vg2ub41omgipvrmur1fnssd3tq.silk
Output: F:\zhuanma\a.pcm
Packets decoded: 338
Decoding Finished
File length: 6.760 s
Time for decoding: 0.012 s (0.176% of realtime)
public static boolean getPcm(String silk,String pcm){
boolean flag = true;
Process p;
String cmd="cmd.exe /c F:\\zhuanma\\silk_v3_decoder.exe -quiet "+silk+" "+pcm;
try
{
Lang.execOutput(cmd, Encoding.CHARSET_GBK);
}
catch (IOException e)
{
e.printStackTrace();
flag = false;
return flag;
}
return flag;
}
StringBuilder msg = Lang.execOutput(cmd, Encoding.CHARSET_GBK);
System.out.println(msg);
Error: unrecognized setting: F:\zhuanma\vg2ub41omgipvrmur1fnssd3tq.pcm
Version:20160922 Build By kn007 (kn007.net)
Github: https://github.com/kn007/silk-v3-decoder
usage: F:\zhuanma\silk_v3_decoder.exe in.bit out.pcm [settings]
in.bit : Bitstream input to decoder
out.pcm : Speech output from decoder
settings:
-Fs_API <Hz> : Sampling rate of output signal in Hz; default: 24000
-loss <perc> : Simulated packet loss percentage (0-100); default: 0
-quiet : Print out just some basic values