Hello, I am trying to run this command in java but I am facing a problem. The same command works perfectly in terminal but when it comes to eclipse I get this
Here is the standard output of the command:
Here is the standard error of the command (if any):
FATAL: "main_align.c", line 935: Failed to open file '/home/bassem/Desktop/inputs/text.insent' for reading: No such file or directory
Here is my code.
publicstaticvoidmain(String[]args){Strings=null;try{Processp=Runtime.getRuntime().exec("sphinx3_align -hmm '/home/bassem/Downloads/cmusphinx-en-us-5.2' -ctl '/home/bassem/Desktop/inputs/input.ctl' -insent '/home/bassem/Desktop/inputs/text.insent' -adchdr 44 -adcin yes -phsegdir '/home/bassem/Desktop/outputs' -wdsegdir '/home/bassem/Desktop/outputs' -dict '/home/bassem/Desktop/inputs/en-us/cmudict-en-us.dict' -cepext .wav -cepdir '' -lowerf 130 -upperf 6800 -nfilt 25 -transform dct -lifter 22");BufferedReaderstdInput=newBufferedReader(newInputStreamReader(p.getInputStream()));BufferedReaderstdError=newBufferedReader(newInputStreamReader(p.getErrorStream()));System.out.println("Here is the standard output of the command:\n");while((s=stdInput.readLine())!=null){System.out.println(s);}System.out.println("Here is the standard error of the command (if any):\n");while((s=stdError.readLine())!=null){System.out.println(s);}System.exit(0);}catch(IOExceptione){System.out.println("exception happened - here's what I know: ");e.printStackTrace();System.exit(-1);}}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, whar did you mean by name ? If you mean directeroies I tried to remove the single quotes and i got a different error
Hereisthestandardoutputofthecommand:Hereisthestandarderrorofthecommand(ifany):InitializationofthelogaddtableLog-Addtablesize=29356x2>>0INFO:feat.c(715):Initializingfeaturestreamtotype:'1s_c_d_dd',ceplen=13,CMN='current',VARNORM='no',AGC='none'INFO:cmn.c(143):mean[0]=12.00,mean[1..12]=0.0ReadingFeatureSpaceTransformfrom:/home/bassem/Downloads/cmusphinx-en-us-5.2/feature_transformReadingHMMinSphinx3ModelformatModelDefinitionFile:/home/bassem/Downloads/cmusphinx-en-us-5.2/mdefMeanFile:/home/bassem/Downloads/cmusphinx-en-us-5.2/meansVarianceFile:/home/bassem/Downloads/cmusphinx-en-us-5.2/variancesMixtureWeightFile:/home/bassem/Downloads/cmusphinx-en-us-5.2/mixture_weightsTransitionMatricesFile:/home/bassem/Downloads/cmusphinx-en-us-5.2/transition_matricesINFO:mdef.c(683):Readingmodeldefinition:/home/bassem/Downloads/cmusphinx-en-us-5.2/mdefInitializationofmdef_t,report:46CI-phone,137053CD-phone,3emitstate/phone,138CI-sen,5138Sen,29045Sen-SeqINFO:kbcore.c(300):UsingoptimizedGMMcomputationforContinuousHMM,-topnwillbeignoredINFO:cont_mgau.c(167):Readingmixturegaussianfile'/home/bassem/Downloads/cmusphinx-en-us-5.2/means'INFO:cont_mgau.c(428):5138mixtureGaussians,32components,1streams,veclen36INFO:cont_mgau.c(167):Readingmixturegaussianfile'/home/bassem/Downloads/cmusphinx-en-us-5.2/variances'INFO:cont_mgau.c(428):5138mixtureGaussians,32components,1streams,veclen36INFO:cont_mgau.c(527):Readingmixtureweightsfile'/home/bassem/Downloads/cmusphinx-en-us-5.2/mixture_weights'INFO:cont_mgau.c(682):Read5138x32mixtureweightsINFO:cont_mgau.c(710):RemovinguninitializedGaussiandensitiesWARN:"cont_mgau.c",line785:16densitiesremoved(0mixturesremovedentirely)INFO:cont_mgau.c(800):ApplyingvariancefloorINFO:cont_mgau.c(818):237variancevaluesflooredINFO:cont_mgau.c(866):PrecomputingMahalanobisdistanceinvariantsINFO:tmat.c(120):ReadingHMMtransitionprobabilitymatrices:/home/bassem/Downloads/cmusphinx-en-us-5.2/transition_matricesInitializationoftmat_t,report:Read46transitionmatricesofsize3x4INFO:dict.c(385):Readingmaindictionary:/home/bassem/Desktop/inputs/en-us/cmudict-en-us.dictINFO:dict.c(388):134522wordsreadINFO:dict.c(393):Readingfillerdictionary:/home/bassem/Downloads/cmusphinx-en-us-5.2/noisedictINFO:dict.c(396):9wordsreadINFO:dict.c(429):Added0fillersfrommdeffileINFO:s3_align.c(1357):logs3(beam)=-491291FATAL:"bio.c",line616:Failedtoopenfile'''//home/bassem/Desktop/inputs/fout.wav' for reading: No such file or directory
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I am trying to run this command in java but I am facing a problem. The same command works perfectly in terminal but when it comes to eclipse I get this
Here is my code.
You should not put name in single quotes, they are assumed to be the part of the filename.
Sorry, whar did you mean by name ? If you mean directeroies I tried to remove the single quotes and i got a different error
I think it cant get the directory of the input from the ctl file
Last edit: bassem magdy 2016-03-05
You need to specify cepdir properly, for example
I tried that but I got this
You need to specify just file names inside ctl file, instead of
/home/bassem/Desktop/inputs/fout, onlyfout.Thank you man for always being helpful.