ConversationTranscriber Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. Recognizer - com.
microsoft. cognitiveservices. speech. transcription. ConversationTranscriber
- com.
- com.
public final class ConversationTranscriber
extends Recognizer
Performs conversation transcribing for audio input streams, and gets transcribed text and speaker id as a result. Note: close() must be called in order to release underlying resources held by the object.
Field Summary
Modifier and Type | Field and Description |
---|---|
final
Event |
canceled
The event canceled signals that the recognition was canceled. |
final
Event |
transcribed
The event transcribed signals that a final recognition result is received. |
final
Event |
transcribing
The event transcribing signals that an intermediate recognition result is received. |
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
protected void |
dispose(boolean disposing)
This method performs cleanup of resources. |
java.lang.String |
getAuthorizationToken()
Gets the authorization token used to communicate with the service. |
Output |
getOutputFormat()
Gets the output format of recognition. |
Property |
getProperties()
The collection of properties and their values defined for this Conversation |
java.lang.String |
getSpeechRecognitionLanguage()
Gets the spoken language of recognition. |
void |
setAuthorizationToken(String token)
Sets the authorization token used to communicate with the service. |
java.util.concurrent.Future<java.lang.Void> |
startTranscribingAsync()
Starts conversation transcribing on a continuous audio stream, until stop |
java.util.concurrent.Future<java.lang.Void> |
stopTranscribingAsync()
Stops conversation transcribing. |
Methods inherited from Recognizer
Methods inherited from java.lang.Object
Field Details
canceled
public final EventHandlerImpl
The event canceled signals that the recognition was canceled.
transcribed
public final EventHandlerImpl
The event transcribed signals that a final recognition result is received.
transcribing
public final EventHandlerImpl
The event transcribing signals that an intermediate recognition result is received.
Constructor Details
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, AutoDetectSourceLanguageConfig autoDetectSourceLangConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, AutoDetectSourceLanguageConfig autoDetectSourceLangConfig, AudioConfig audioConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, SourceLanguageConfig sourceLanguageConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, SourceLanguageConfig sourceLanguageConfig, AudioConfig audioConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, AudioConfig audioConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, String sourceLanguage)
Initializes a new instance of Conversation Transcriber.
Parameters:
ConversationTranscriber
public ConversationTranscriber(SpeechConfig speechConfig, String sourceLanguage, AudioConfig audioConfig)
Initializes a new instance of Conversation Transcriber.
Parameters:
Method Details
dispose
protected void dispose(boolean disposing)
This method performs cleanup of resources. The Boolean parameter disposing indicates whether the method is called from Dispose (if disposing is true) or from the finalizer (if disposing is false). Derived classes should override this method to dispose resource if needed.
Overrides:
ConversationTranscriber.dispose(boolean disposing)Parameters:
getAuthorizationToken
public String getAuthorizationToken()
Gets the authorization token used to communicate with the service.
Returns:
getOutputFormat
public OutputFormat getOutputFormat()
Gets the output format of recognition.
Returns:
getProperties
public PropertyCollection getProperties()
The collection of properties and their values defined for this ConversationTranscriber.
Returns:
getSpeechRecognitionLanguage
public String getSpeechRecognitionLanguage()
Gets the spoken language of recognition.
Returns:
setAuthorizationToken
public void setAuthorizationToken(String token)
Sets the authorization token used to communicate with the service. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. Otherwise, the recognizer will encounter errors during recognition.
Parameters:
startTranscribingAsync
public Future
Starts conversation transcribing on a continuous audio stream, until stopTranscribingAsync() is called. User must subscribe to events to receive transcription results.
Returns:
stopTranscribingAsync
public Future
Stops conversation transcribing.
Returns: