KeenASR Unity Plugin 2.1.3
Unity plugin for KeenASR offline speech recognition SDK (iOS & Android)
Loading...
Searching...
No Matches
KeenResearch.ASRResponse Class Reference

Wraps a single recognition response, providing access to the recognition result, audio quality metrics, and metadata. Also exposes methods to save response data or queue it for upload to Dashboard. More...

Inherits IDisposable.

Public Member Functions

bool QueueForUpload ()
 Queues audio and JSON from this response for upload to Dashboard. Files are saved to an internal directory scanned by the uploader background thread. Requires StartDataUploader() to have been called for files to actually be uploaded.
 
bool SaveJsonFile (string directoryPath)
 Saves the JSON representation of this response to the specified directory.
 
bool SaveAudioFile (string directoryPath)
 Saves the audio recording for this response to the specified directory. After saving, the filename is available via the audioFilename property.
 
void Dispose ()
 Releases the native handle associated with this response. This method is idempotent and safe to call multiple times. Properties such as result, responseId, and duration remain accessible after disposal.
 

Properties

ASRResult result [get]
 The recognition result (text, words, phonemes, confidence).
 
ASRAudioQualityResult audioQualityResult [get]
 Audio quality metrics (SNR, RMS levels, clipping) for the captured audio.
 
string responseId [get]
 Unique identifier for this response, assigned by the native SDK.
 
string decodingGraphName [get]
 Name of the decoding graph that was used for recognition.
 
string asrBundleName [get]
 Name of the ASR bundle that was used for recognition.
 
bool echoCancellation [get]
 True if echo cancellation was active during this recognition session.
 
double duration [get]
 Total duration of the response audio in seconds.
 
string startTime [get]
 Timestamp when recognition started (formatted string).
 
string audioFilename [get]
 Filename of the saved audio file. Available after calling SaveAudioFile().
 

Detailed Description

Wraps a single recognition response, providing access to the recognition result, audio quality metrics, and metadata. Also exposes methods to save response data or queue it for upload to Dashboard.

The caller receives ownership of this object and must call Dispose() when done to release the underlying native handle. If Dispose() is not called, the finalizer will release the handle during garbage collection, but this should not be relied upon.

Member Function Documentation

◆ Dispose()

void KeenResearch.ASRResponse.Dispose ( )
inline

Releases the native handle associated with this response. This method is idempotent and safe to call multiple times. Properties such as result, responseId, and duration remain accessible after disposal.

◆ QueueForUpload()

bool KeenResearch.ASRResponse.QueueForUpload ( )
inline

Queues audio and JSON from this response for upload to Dashboard. Files are saved to an internal directory scanned by the uploader background thread. Requires StartDataUploader() to have been called for files to actually be uploaded.

Returns
true if files were queued successfully, false otherwise.
Exceptions
ObjectDisposedExceptionThrown if this response has been disposed.

◆ SaveAudioFile()

bool KeenResearch.ASRResponse.SaveAudioFile ( string  directoryPath)
inline

Saves the audio recording for this response to the specified directory. After saving, the filename is available via the audioFilename property.

Parameters
directoryPathPath to an existing, writable directory.
Returns
true if the file was saved successfully, false otherwise.
Exceptions
ObjectDisposedExceptionThrown if this response has been disposed.

◆ SaveJsonFile()

bool KeenResearch.ASRResponse.SaveJsonFile ( string  directoryPath)
inline

Saves the JSON representation of this response to the specified directory.

Parameters
directoryPathPath to an existing, writable directory.
Returns
true if the file was saved successfully, false otherwise.
Exceptions
ObjectDisposedExceptionThrown if this response has been disposed.

Property Documentation

◆ asrBundleName

string KeenResearch.ASRResponse.asrBundleName
get

Name of the ASR bundle that was used for recognition.

◆ audioFilename

string KeenResearch.ASRResponse.audioFilename
get

Filename of the saved audio file. Available after calling SaveAudioFile().

◆ audioQualityResult

ASRAudioQualityResult KeenResearch.ASRResponse.audioQualityResult
get

Audio quality metrics (SNR, RMS levels, clipping) for the captured audio.

◆ decodingGraphName

string KeenResearch.ASRResponse.decodingGraphName
get

Name of the decoding graph that was used for recognition.

◆ duration

double KeenResearch.ASRResponse.duration
get

Total duration of the response audio in seconds.

◆ echoCancellation

bool KeenResearch.ASRResponse.echoCancellation
get

True if echo cancellation was active during this recognition session.

◆ responseId

string KeenResearch.ASRResponse.responseId
get

Unique identifier for this response, assigned by the native SDK.

◆ result

ASRResult KeenResearch.ASRResponse.result
get

The recognition result (text, words, phonemes, confidence).

◆ startTime

string KeenResearch.ASRResponse.startTime
get

Timestamp when recognition started (formatted string).