private void convertWav2Raw(String wavDirName, String rawDirName) { String cmdLine; String wav2rawCmd = scriptsDir + "wav2raw.sh"; System.out.println("Converting wav files to raw from: " + wavDirName + " to: " + rawDirName); File rawDir = new File(rawDirName); if (!rawDir.exists()) rawDir.mkdir(); cmdLine = "chmod +x " + wav2rawCmd; General.launchProc(cmdLine, "wav2raw", voiceDir); cmdLine = wav2rawCmd + " " + soxPath + " " + wavDirName + " " + rawDirName; General.launchProc(cmdLine, "wav2raw", voiceDir); }
private void convertUtt2Text(String userUttDirName, String textDirName) { String cmdLine; String utt2transCmd = scriptsDir + "utt2trans.sh"; // festival to mary format System.out.println("\nConverting transcription files (festival format) to text from: " + userUttDirName + " to: " + textDirName); File textDir = new File(textDirName); if (!textDir.exists()) textDir.mkdir(); cmdLine = "chmod +x " + utt2transCmd; General.launchProc(cmdLine, "utt2trans", voiceDir); cmdLine = utt2transCmd + " " + userUttDirName + " " + textDirName; General.launchProc(cmdLine, "utt2trans", voiceDir); }
private void convertRaw2Wav(String rawDirName, String wavDirName) { String Fs = db.getProperty(DatabaseLayout.SAMPLINGRATE); String cmdLine; String raw2wavCmd = scriptsDir + "raw2wav.sh"; System.out.println("Converting raw files to wav from: " + rawDirName + " to: " + wavDirName); File wavDir = new File(wavDirName); if (!wavDir.exists()) wavDir.mkdir(); cmdLine = "chmod +x " + raw2wavCmd; General.launchProc(cmdLine, "raw2wav", voiceDir); cmdLine = raw2wavCmd + " " + soxPath + " " + rawDirName + " " + wavDirName + " " + Fs; General.launchProc(cmdLine, "raw2wav", voiceDir); }
General.launchProc(cmdLine, "LPC ", baseNameArray[i]);
General.launchProc(cmdLine, "Mel-Cepstrum ", baseNameArray[i]);
General.launchProc(cmdLine, "Pitchmarks ", baseNameArray[i]); + "-o " + pitchmarksDirName + baseNameArray[i] + pitchmarksExt + " tmp" + baseNameArray[i] + db.getProp(db.WAVEXT); General.launchProc(cmdLine, "Pitchmarks ", baseNameArray[i]); General.launchProc(cmdLine, "Pitchmarks ", baseNameArray[i]);
strTmp = getProp(COMMAND) + " " + strTmp; General.launchProc(strTmp, "SnackF0ContourExtractor", baseNameArray[i]);
@Deprecated protected boolean praatPitchmarks(String basename) throws IOException { String wavFilename = new File(getProp(WAVEDIR) + basename + db.getProp(db.WAVEXT)).getAbsolutePath(); String pointprocessFilename = getProp(PRAATPMDIR) + basename + pointpExt; String strTmp = getProp(COMMAND) + " " + tmpScript + " " + wavFilename + " " + pointprocessFilename + " " + getProp(MINPITCH) + " " + getProp(MAXPITCH); if (MaryUtils.isWindows()) strTmp = "cmd.exe /c " + strTmp; General.launchProc(strTmp, "PraatPitchmarker", basename); // Now convert the praat format into EST pm format: estPitchmarks(basename); return true; }
General.launchProc(cmd, "sox", inFile);
praatCommand = "cmd.exe /c " + praatCommand; General.launchProc(praatCommand, getName(), "");
/** * Compute MGC features for all RAW files using SPTK * * @throws Exception * if can't run command */ private void computeMGCFeatures() throws Exception { for (int i = 0; i < bnlVocalizations.getLength(); i++) { String rawFile = getProp(RAWDIR) + File.separator + bnlVocalizations.getName(i) + rawExt; String mgcFile = getProp(MLSADIR) + File.separator + bnlVocalizations.getName(i) + mgcExt; String command = getProp(this.SCRIPTSDIR) + File.separator + "get_mgc.sh " + getProp(SPTKPATH) + " " + FRAMELEN + " " + FRAMESHIFT + " " + FFTLEN + " " + FREQWARP + " " + MGCORDER + " " + rawFile + " " + mgcFile; try { General.launchProc(command, "MLSAFeatureFileComputer", bnlVocalizations.getName(i)); } catch (Exception e) { throw new ExecutionException("\nCommand failed : " + command + "\n" + e); } File lf0EmptyFile = new File(mgcFile); if (lf0EmptyFile.length() <= 0) { // delete all empty files lf0EmptyFile.delete(); } // System.out.println( "Command: " + command ); File lf0NFile = new File(mgcFile); if (!lf0NFile.exists()) { throw new ExecutionException("The following command failed: \n " + command + "\n"); } System.out.println("Computed MGC features for " + bnlVocalizations.getName(i)); } }
/** * Convert all WAV files to RAW files to support SPTK * * @throws IOException * if can't run command * @throws ExecutionException * if commandline throws an error */ private void convertWAVE2RAW() throws Exception { for (int i = 0; i < bnlVocalizations.getLength(); i++) { String waveFile = getProp(WAVEDIR) + File.separator + bnlVocalizations.getName(i) + waveExt; String rawFile = getProp(RAWDIR) + File.separator + bnlVocalizations.getName(i) + rawExt; String command = getProp(SOXCOMMAND) + " " + waveFile + " " + rawFile; // System.out.println( "Command: " + command ); try { General.launchProc(command, "MLSAFeatureFileComputer", bnlVocalizations.getName(i)); } catch (Exception e) { throw new ExecutionException("\nCommand failed : " + command + "\n" + e); } File rawEmptyFile = new File(rawFile); if (rawEmptyFile.length() <= 0) { // delete all empty files rawEmptyFile.delete(); } System.out.println("Creating " + bnlVocalizations.getName(i) + " RAW file"); File rawNFile = new File(rawFile); if (!rawNFile.exists()) { throw new ExecutionException("The following command failed: \n " + command + "\n"); } } }
+ getProp(LOWERLF0) + " " + getProp(UPPERLF0) + " " + STRORDER + " " + rawFile + " " + strFile + " "; try { General.launchProc(command, "MLSAFeatureFileComputer", bnlVocalizations.getName(i)); } catch (Exception e) { throw new ExecutionException("\nCommand failed : " + command + "\n" + e);
+ FRAMESHIFT + " " + getProp(LOWERLF0) + " " + getProp(UPPERLF0); try { General.launchProc(command, "MLSAFeatureFileComputer", bnlVocalizations.getName(i)); } catch (Exception e) { throw new ExecutionException("\nCommand failed : " + command + "\n" + e);
General.launchProc(cmdLine, "HHEd", filedir); General.launchProc(cmdLine, "HHEd", filedir); General.launchProc(cmdLine, "mv", filedir); General.launchProc(cmdLine, "mv", filedir);
General.launchProc(cmdLine, "configure", filedir); General.launchProc(cmdLine, "configure", filedir);