KeenASR Framework v2.1 (8b72cc4)
Keen Research
Loading...
Searching...
No Matches
KIOSResponse Class Reference

#include <KIOSResponse.h>

Properties

KIOSResultresult
Various response properties
NSString * decodingGraphName
NSString * asrBundleName
NSString * json
NSString * responseId
BOOL echoCancellation
KIOSAudioQualityResultaudioQualityResult

File saving

Response instance contains json and audio, which can be saved to the filesystem. .

NSString * jsonFilename
NSString * audioFilename
(BOOL) - saveJsonFile:
(BOOL) - saveAudioFile:
(BOOL) - queueForUpload

Detailed Description

An instance of the KIOSResponse class, called response provides various information about the specifc run of a recognizer, including KIOSResult and additional metadata about recognition and audio setup

Method Documentation

◆ queueForUpload

- (BOOL) queueForUpload

Queues audio and json from this response for an upload to Dashboard. This method will save audio and json in an internal directory that's scanned by the KASRUploder background thread.

If KIOSUploader background thread is not setup, the files will never be removed. With KIOSUploader background thread running, the files will be uploaded to the Keen Research Dashboard service as long as internet connectivity is available.

Returns
true if files were queued for the upload, false otherwise.

◆ saveAudioFile:

- (BOOL) saveAudioFile: (nonnull NSURL *) dirpath

Saves audio file in the specified filepath in the filesystem. The name of the file can be obtained via audioFilename property.

Parameters
dirpathinstance of the URL object that points to the directory in which the audio file should be saved.
Returns
TRUE if file was succesfully saved, false otherwise. This method will fail if the dirpath does not point to an existing directory, or if you attempt to pass a dirpath that points to internal directory KeenASR SDK uses for uploades to Dashboard or if the directory is not writeable.

◆ saveJsonFile:

- (BOOL) saveJsonFile: (nonnull NSURL *) dirpath

Saves JSON representation of the response in the specified filepath in the filesystem. The name of the file can be obtained via jsonFilename property.

Parameters
dirpathinstance of the URL object that points to the directory in which the JSON file should be saved
Returns
TRUE if file was succesfully saved, false otherwise. This method will fail if the dirpath does not point to an existing directory, or if you attempt to pass a dirpath that points to internal directory KeenASR SDK uses for uploades to Dashboard or if the directory is not writeable.

Property Documentation

◆ asrBundleName

- (NSString*) asrBundleName
readnonatomicassign

name of the ASR Bundle that was used for recognition

◆ audioFilename

- (NSString*) audioFilename
readnonatomicassign

Full path to the the audio file that corresponds to this response. This file will be available only after call to saveAudioFile method

◆ audioQualityResult

- (KIOSAudioQualityResult*) audioQualityResult
readnonatomicassign

audio quality result

◆ decodingGraphName

- (NSString*) decodingGraphName
readnonatomicassign

name of the decoding graph that was used for recognition

◆ echoCancellation

- (BOOL) echoCancellation
readnonatomicassign

BOOL value that's set to true if echo cancellation was used during recognition of this response, or false if it wasn't (the value is captured and persisted at the end of recognition)

◆ json

- (NSString*) json
readnonatomicassign

JSON for this response

◆ jsonFilename

- (NSString*) jsonFilename
readnonatomicassign

Full path to the json file that corresponds to this response. This file will be available only after call to saveJsonFile method

◆ responseId

- (NSString*) responseId
readnonatomicassign

id of this response. This corresponds to the id set via startListening method

◆ result

- (KIOSResult*) result
readnonatomicassign

an instance of KIOSResult that provides final result corresponding to this response


The documentation for this class was generated from the following file: