libgspeech
tem vinculações JNI e uma API Java criada com base nas vinculações JNI. Exemplos
de aplicativos que usam vinculações Java
Hospedado em https://libgspeech.googlesource.com/libgspeech-guides/
Vinculações em Java
Vinculações em Java para libgspeech
, elas estão em um estágio inicial e estão sujeitas
a mudanças.
package com.google.libgspeech;
public class GoogleSpeech {
public enum PollingType {
NON_BLOCKING,
BLOCKING_TIMEOUT,
BLOCKING,
}
static {
System.loadLibrary("gspeech_jni");
}
/** Create Speech object with API key `key` */
public GoogleSpeech(String key) { ... }
/**
* Initialize Speech with the provided initialization configuration.
* This methods will load models into memory.
*/
public boolean init(SpeechInitConfig initConfig) throws GoogleSpeechException { ... }
/** Check if Speech isPrepared, initialized but not shutdown. */
public boolean isPrepared() throws GoogleSpeechException { ... }
/**
* Start Speech, starts the pipeline and starts reading from the
* internal audio buffer.
*/
public boolean start(SpeechStartConfig startConfig) throws GoogleSpeechException { ... }
/** Check if Speech is running by not stopped. */
public boolean isRunning() throws GoogleSpeechException { ... }
/** Stop Speech, undo the start. */
public boolean stop() throws GoogleSpeechException { ... }
/** Shutdown Speech, undo the initialization. */
public boolean shutdown() throws GoogleSpeechException { ... }
/** Poll Speech for events. */
public SpeechEvents pollEvents(GoogleSpeech.PollingType pollingType, int timeoutMs) throws GoogleSpeechException { ... }
/** Tell G_Speech that the current audio source is done. */
public void markEndOfAudio();
/** Push audio into Speech. */
public boolean pushAudio(byte[] audio) throws GoogleSpeechException { ... }
/** Clean-up. */
protected void finalize() throws GoogleSpeechException { ... }
}