public void close() { if (status != NOT_OPENED) { if (stream != null) { try { stream.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } stream = null; status = NOT_OPENED; } }
public void close() { if (status != NOT_OPENED) { if (stream != null) { try { stream.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } stream = null; status = NOT_OPENED; } }
public static void readMfccsFromFloat(MaryRandomAccessFile stream, MfccFileHeader params, double[][] outputMfccs) throws IOException { if (stream != null && params.numfrm > 0 && params.dimension > 0) { int i, j; for (i = 0; i < params.numfrm; i++) { for (j = 0; j < params.dimension; j++) outputMfccs[i][j] = (double) (stream.readFloat()); } stream.close(); } }
public static void writeMfccsFloat(MaryRandomAccessFile stream, double[][] mfccs) throws IOException { if (stream != null && mfccs != null && mfccs.length > 0) { int i, j; for (i = 0; i < mfccs.length; i++) { for (j = 0; j < mfccs[i].length; j++) stream.writeFloat((float) mfccs[i][j]); } stream.close(); } }
public static void writeMfccsFloat(MaryRandomAccessFile stream, double[][] mfccs) throws IOException { if (stream != null && mfccs != null && mfccs.length > 0) { int i, j; for (i = 0; i < mfccs.length; i++) { for (j = 0; j < mfccs[i].length; j++) stream.writeFloat((float) mfccs[i][j]); } stream.close(); } }
public static void readMfccsFromFloat(MaryRandomAccessFile stream, MfccFileHeader params, double[][] outputMfccs) throws IOException { if (stream != null && params.numfrm > 0 && params.dimension > 0) { int i, j; for (i = 0; i < params.numfrm; i++) { for (j = 0; j < params.dimension; j++) outputMfccs[i][j] = (double) (stream.readFloat()); } stream.close(); } }
public static double[][] readMfccsFromFloat(MaryRandomAccessFile stream, MfccFileHeader params) throws IOException { double[][] mfccs = null; if (stream != null && params.numfrm > 0 && params.dimension > 0) { mfccs = new double[params.numfrm][params.dimension]; int i, j; for (i = 0; i < mfccs.length; i++) { for (j = 0; j < mfccs[i].length; j++) mfccs[i][j] = (double) (stream.readFloat()); } stream.close(); } return mfccs; }
public static double[][] readMfccsFromFloat(MaryRandomAccessFile stream, MfccFileHeader params) throws IOException { double[][] mfccs = null; if (stream != null && params.numfrm > 0 && params.dimension > 0) { mfccs = new double[params.numfrm][params.dimension]; int i, j; for (i = 0; i < mfccs.length; i++) { for (j = 0; j < mfccs[i].length; j++) mfccs[i][j] = (double) (stream.readFloat()); } stream.close(); } return mfccs; }
public MaryRandomAccessFile writePitchHeader(String pitchFile, boolean bLeaveStreamOpen) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(pitchFile, "rw"); if (stream != null) { writePitchHeader(stream); if (!bLeaveStreamOpen) { stream.close(); stream = null; } } return stream; }
public void read(String gmmFile) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(gmmFile, "r"); read(stream); stream.close(); }
public static void writeRawMfccFile(double[][] mfccs, String mfccFileOut) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(mfccFileOut, "rw"); if (stream != null) { writeMfccsFloat(stream, mfccs); stream.close(); } }
public void write(String gmmFile) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(gmmFile, "rw"); write(stream); stream.close(); }
public void write(String gmmFile) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(gmmFile, "rw"); write(stream); stream.close(); }
public void read(String gmmFile) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(gmmFile, "r"); read(stream); stream.close(); }
public MaryRandomAccessFile writePitchHeader(String pitchFile, boolean bLeaveStreamOpen) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(pitchFile, "rw"); if (stream != null) { writePitchHeader(stream); if (!bLeaveStreamOpen) { stream.close(); stream = null; } } return stream; }
public static void writeRawMfccFile(double[][] mfccs, String mfccFileOut) throws IOException { MaryRandomAccessFile stream = new MaryRandomAccessFile(mfccFileOut, "rw"); if (stream != null) { writeMfccsFloat(stream, mfccs); stream.close(); } }
public static void WriteEnergyFile(EnergyContourRms en, String energyFile) throws IOException { if (en.contour != null) { en.header.totalFrames = en.contour.length; MaryRandomAccessFile ler = null; try { ler = new MaryRandomAccessFile(energyFile, "rw"); } catch (FileNotFoundException e) { throw new IOException("File not found: " + energyFile); } en.header.write(ler); ler.writeDouble(en.contour); ler.close(); } }
public static void WriteEnergyFile(EnergyContourRms en, String energyFile) throws IOException { if (en.contour != null) { en.header.totalFrames = en.contour.length; MaryRandomAccessFile ler = null; try { ler = new MaryRandomAccessFile(energyFile, "rw"); } catch (FileNotFoundException e) { throw new IOException("File not found: " + energyFile); } en.header.write(ler); ler.writeDouble(en.contour); ler.close(); } }
public static EnergyContourRms ReadEnergyFile(String energyFile) throws IOException { EnergyContourRms en = null; MaryRandomAccessFile ler = null; try { ler = new MaryRandomAccessFile(energyFile, "r"); } catch (FileNotFoundException e) { throw new IOException("File not found: " + energyFile); } en = new EnergyContourRms(); en.header.read(ler, true); en.contour = ler.readDouble(en.header.totalFrames); ler.close(); return en; } }
public void read(MaryRandomAccessFile ler, boolean bLeaveOpen) throws IOException { try { samplingRate = ler.readInt(); windowSizeInSeconds = ler.readDouble(); skipSizeInSeconds = ler.readDouble(); totalFrames = ler.readInt(); if (!bLeaveOpen) { ler.close(); } } catch (IOException e) { throw e; } } }