If you think the Android project K6nele listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package ee.ioc.phon.android.speak;
//www.java2s.comimport java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
publicclass Constants {
publicenum State {INIT, RECORDING, LISTENING, TRANSCRIBING, ERROR}
;
// When does the chunk sending start and what is its interval
publicstaticfinalint TASK_INTERVAL_SEND = 300;
publicstaticfinalint TASK_DELAY_SEND = 100;
// We send more frequently in the IME
publicstaticfinalint TASK_INTERVAL_IME_SEND = 200;
publicstaticfinalint TASK_DELAY_IME_SEND = 100;
// Check the volume 10 times a second
publicstaticfinalint TASK_INTERVAL_VOL = 100;
// Wait for 1/2 sec before starting to measure the volume
publicstaticfinalint TASK_DELAY_VOL = 500;
publicstaticfinalint TASK_INTERVAL_STOP = 1000;
publicstaticfinalint TASK_DELAY_STOP = 1000;
publicstaticfinal String AUDIO_FILENAME = "audio.wav";
publicstaticfinal String DEFAULT_AUDIO_FORMAT = "audio/wav";
publicstaticfinal Set<String> SUPPORTED_AUDIO_FORMATS =
new HashSet<String>(Arrays.asList(DEFAULT_AUDIO_FORMAT));
// TODO: take these from some device specific configuration
publicstaticfinalfloat DB_MIN = 15.0f;
publicstaticfinalfloat DB_MAX = 30.0f;
publicstaticfinal Set<Character> CHARACTERS_WS =
new HashSet<>(Arrays.asList(new Character[]{' ', '\n', '\t'}));
// Symbols that should not be preceded by space in a written text.
publicstaticfinal Set<Character> CHARACTERS_PUNCT =
new HashSet<>(Arrays.asList(new Character[]{',', ':', ';', '.', '!', '?'}));
// Symbols after which the next word should be capitalized.
publicstaticfinal Set<Character> CHARACTERS_EOS =
new HashSet<>(Arrays.asList(new Character[]{'.', '!', '?'}));
}