TranslationRecognitionResult Class

Defines the translation text result.

Constructor for internal use.

Constructor

TranslationRecognitionResult(handle: c_void_p)

Parameters

Name Description
handle
Required

Attributes

cancellation_details

The reason why recognition was cancelled.

Returns None if there was no cancellation.

channel

Index of the input audio channel where the speech was recognized. Numbering starts at zero.

commit_token

The commit token this result acknowledges, or 0 if the result is not a commit acknowledgment.

When an application calls commit, the returned token appears here on the result that acknowledges that commit, so the application can correlate the two.

A commit that finalizes a segment containing speech is acknowledged by a normal recognized result carrying the token. A commit issued when no audio is left in processing is acknowledged by a result with reason ResultReason.NoMatch, an empty text and zero duration, which also carries the token.

duration

Duration of recognized speech in ticks. A single tick represents one hundred nanoseconds or one ten-millionth of a second.

error_json

The bare JSON representation of the error from the Speech Service.

json

The bare JSON representation of the result from the Speech Service.

no_match_details

Detailed information for NoMatch recognition results.

Returns None if there was a match found.

offset

Offset of the recognized speech in ticks. A single tick represents one hundred nanoseconds or one ten-millionth of a second.

properties

Other properties of the result.

Returns

Type Description

dict indexed with PropertyId, and str values.

reason

Recognition reason.

result_id

Unique result id.

text

Normalized text generated by a speech recognition engine from recognized input.

translations

Presents the translation results. Each item in the map is a key value pair, where key is the language tag of the translated text, and value is the translation text in that language.