public class SpeechToText extends WatsonService
| Modifier and Type | Field and Description |
|---|---|
static String |
AUDIO |
static String |
CONTENT_TYPE |
static String |
CONTINUOUS |
static String |
INACTIVITY_TIMEOUT |
static String |
MAX_ALTERNATIVES |
static String |
MODEL |
static String |
SESSION_ID |
static String |
TIMESTAMPS |
static String |
WORD_CONFIDENCE |
| Constructor and Description |
|---|
SpeechToText()
Instantiates a new speech to text.
|
| Modifier and Type | Method and Description |
|---|---|
SpeechSession |
createSession()
Create a session to lock an engine to the session.
|
SpeechSession |
createSession(String model)
Create a session to lock an engine to the session.
|
void |
deleteSession(SpeechSession session)
Delete a session.
|
SpeechModel |
getModel(SpeechModel watsonModel)
Gets the model.
|
SpeechModel |
getModel(String name)
Gets the speech model.
|
List<SpeechModel> |
getModels()
Gets the models.
|
SessionStatus |
getRecognizeStatus(SpeechSession session)
Get the recognize status.
|
SessionStatus |
getRecognizeStatus(String sessionId)
Gets the session status.
|
SpeechResults |
recognize(File audio,
String contentType)
Recognize.
|
SpeechResults |
recognize(Map<String,Object> params)
Recognize.
|
execute, executeWithoutResponse, getApiKey, getDefaultContentType, getDefaultRequestParams, getEndPoint, getGson, getHttpClient, getThreadSafeClient, setApiKey, setEndPoint, setUsernameAndPassword, toStringpublic static final String MODEL
public static final String INACTIVITY_TIMEOUT
public static final String TIMESTAMPS
public static final String MAX_ALTERNATIVES
public static final String WORD_CONFIDENCE
public static final String CONTINUOUS
public static final String SESSION_ID
public static final String CONTENT_TYPE
public static final String AUDIO
public SpeechSession createSession()
SpeechSessionpublic SpeechSession createSession(String model)
model - the modelSpeechSessionpublic void deleteSession(SpeechSession session)
session - the speech sessionpublic SpeechModel getModel(SpeechModel watsonModel)
watsonModel - the watson modelpublic SpeechModel getModel(String name)
name - the namepublic List<SpeechModel> getModels()
public SessionStatus getRecognizeStatus(SpeechSession session)
session - the sessiongetRecognizeStatus(String)public SessionStatus getRecognizeStatus(String sessionId)
recognize(File, String).sessionId - the session idpublic SpeechResults recognize(File audio, String contentType)
audio - the audio filecontentType - the content typepublic SpeechResults recognize(Map<String,Object> params)
params - the parameters to use for the recognition. for example:
"word_confidence", "continuous", "max_alternatives",
"timestamps", "inactivity_timeout", "model", "session_id",
content_typeCopyright © 2015. All rights reserved.