/** * Verify if the java virtual machine is in a very low memory condition. The memory is considered very low if less than half a * specified value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code> * .The threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in very low memory condition. */ public static boolean veryLowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold() / 2; }
/** * Constructor to be called with instantiated objects. * * @param locale * locale */ public DummyDuration2AcoustParams(String locale) { super("DummyAllophones2AcoustParams", MaryDataType.DURATIONS, MaryDataType.ACOUSTPARAMS, MaryUtils.string2locale(locale)); }
public static int[] toIntArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 4 != 0) return null; int[] ints = new int[byteArray.length / 4]; for (int i = 0; i < ints.length; i++) { ints[i] = toInt(new byte[] { byteArray[(i * 4)], byteArray[(i * 4) + 1], byteArray[(i * 4) + 2], byteArray[(i * 4) + 3], }); } return ints; }
public VoiceSectioner(String s, Voice defaultVoice) { this.s = s; this.pos = 0; this.currentVoice = defaultVoice; this.logger = MaryUtils.getLogger("VoiceSectioner"); }
public static char[] toCharArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 2 != 0) return null; char[] chrs = new char[byteArray.length / 2]; for (int i = 0; i < chrs.length; i++) { chrs[i] = toChar(new byte[] { byteArray[(i * 2)], byteArray[(i * 2) + 1], }); } return chrs; }
public static long[] toLongArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 8 != 0) return null; long[] lngs = new long[byteArray.length / 8]; for (int i = 0; i < lngs.length; i++) { lngs[i] = toLong(new byte[] { byteArray[(i * 8)], byteArray[(i * 8) + 1], byteArray[(i * 8) + 2], byteArray[(i * 8) + 3], byteArray[(i * 8) + 4], byteArray[(i * 8) + 5], byteArray[(i * 8) + 6], byteArray[(i * 8) + 7], }); } return lngs; }
public static float[] toFloatArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 4 != 0) return null; float[] flts = new float[byteArray.length / 4]; for (int i = 0; i < flts.length; i++) { flts[i] = toFloat(new byte[] { byteArray[(i * 4)], byteArray[(i * 4) + 1], byteArray[(i * 4) + 2], byteArray[(i * 4) + 3], }); } return flts; }
public static short[] toShortArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 2 != 0) return null; short[] shts = new short[byteArray.length / 2]; for (int i = 0; i < shts.length; i++) { shts[i] = toShort(new byte[] { byteArray[(i * 2)], byteArray[(i * 2) + 1] }); } return shts; }
/** * Constructor to be called with instantiated objects. * * @param locale * locale */ public DummyAllophones2AcoustParams(String locale) { super("DummyAllophones2AcoustParams", MaryDataType.ALLOPHONES, MaryDataType.ACOUSTPARAMS, MaryUtils.string2locale(locale)); }
public VoiceSectioner(String s, Voice defaultVoice) { this.s = s; this.pos = 0; this.currentVoice = defaultVoice; this.logger = MaryUtils.getLogger("VoiceSectioner"); }
/** * Verify if the java virtual machine is in a very low memory condition. The memory is considered very low if less than half a * specified value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code> * .The threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in very low memory condition. */ public static boolean veryLowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold() / 2; }
public static int[] toIntArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 4 != 0) return null; int[] ints = new int[byteArray.length / 4]; for (int i = 0; i < ints.length; i++) { ints[i] = toInt(new byte[] { byteArray[(i * 4)], byteArray[(i * 4) + 1], byteArray[(i * 4) + 2], byteArray[(i * 4) + 3], }); } return ints; }
public static char[] toCharArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 2 != 0) return null; char[] chrs = new char[byteArray.length / 2]; for (int i = 0; i < chrs.length; i++) { chrs[i] = toChar(new byte[] { byteArray[(i * 2)], byteArray[(i * 2) + 1], }); } return chrs; }
public static long[] toLongArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 8 != 0) return null; long[] lngs = new long[byteArray.length / 8]; for (int i = 0; i < lngs.length; i++) { lngs[i] = toLong(new byte[] { byteArray[(i * 8)], byteArray[(i * 8) + 1], byteArray[(i * 8) + 2], byteArray[(i * 8) + 3], byteArray[(i * 8) + 4], byteArray[(i * 8) + 5], byteArray[(i * 8) + 6], byteArray[(i * 8) + 7], }); } return lngs; }
public static float[] toFloatArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 4 != 0) return null; float[] flts = new float[byteArray.length / 4]; for (int i = 0; i < flts.length; i++) { flts[i] = toFloat(new byte[] { byteArray[(i * 4)], byteArray[(i * 4) + 1], byteArray[(i * 4) + 2], byteArray[(i * 4) + 3], }); } return flts; }
public static short[] toShortArray(byte[] byteArray) { if (byteArray == null || byteArray.length % 2 != 0) return null; short[] shts = new short[byteArray.length / 2]; for (int i = 0; i < shts.length; i++) { shts[i] = toShort(new byte[] { byteArray[(i * 2)], byteArray[(i * 2) + 1] }); } return shts; }
/** * Constructor to be called with instantiated objects. * * @param locale * locale */ public AcousticModeller(String locale) { this(MaryUtils.string2locale(locale)); }
/** * Verify if the java virtual machine is in a low memory condition. The memory is considered low if less than a specified * value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code>.The * threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in low memory condition. */ public static boolean lowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold(); }
/** * Constructor to be called with instantiated objects. * * @param locale * locale */ public DummyDuration2AcoustParams(String locale) { super("DummyAllophones2AcoustParams", MaryDataType.DURATIONS, MaryDataType.ACOUSTPARAMS, MaryUtils.string2locale(locale)); }
/** * Verify if the java virtual machine is in a low memory condition. The memory is considered low if less than a specified * value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code>.The * threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in low memory condition. */ public static boolean lowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold(); }