9#ifndef KIOSRecognizer_h
10#define KIOSRecognizer_h
18typedef NS_ENUM(NSInteger, KIOSRecognizerType) {
20 KIOSRecognizerTypeUnknown = -1,
22 KIOSRecognizerTypeGMM,
24 KIOSRecognizerTypeNNet,
26 KIOSRecognizerTypeNNet3,
28 KIOSRecognizerTypeNNet3Chain
33typedef NS_ENUM(NSInteger, KIOSRecognizerLogLevel) {
35 KIOSRecognizerLogLevelDebug=0,
37 KIOSRecognizerLogLevelInfo,
39 KIOSRecognizerLogLevelWarning,
43typedef NS_ENUM(NSInteger, KIOSRecognizerState) {
46 KIOSRecognizerStateNeedsDecodingGraph=0,
48 KIOSRecognizerStateReadyToListen,
50 KIOSRecognizerStateListening,
56 KIOSRecognizerStateFinalProcessing,
76typedef NS_ENUM(NSInteger, KIOSVadParameter) {
79 KIOSVadTimeoutForNoSpeech=0,
83 KIOSVadTimeoutEndSilenceForGoodMatch,
87 KIOSVadTimeoutEndSilenceForAnyMatch,
92 KIOSVadTimeoutMaxDuration
106@property(nonatomic, readonly, nonnull) NSString *
text;
109@property(nonatomic, readonly, nonnull) NSString *
cleanText;
112@property(nonatomic, strong, readonly, nullable) NSArray<KIOSWord *> *
words;
114@property(nonatomic, readonly, nullable) NSNumber *confidence DEPRECATED_MSG_ATTRIBUTE(
"Deprecated");
117- (nonnull NSString *)description;
142- (nullable NSDictionary *)toDictionary;
156@property (nonatomic, readonly, nonnull) NSString *
text;
159@property (nonatomic, strong, nullable, readonly) NSNumber *
startTime;
162@property (nonatomic, strong, nullable, readonly) NSNumber *
duration;
164@property (nonatomic, strong, nullable, readonly) NSNumber *confidence
165__deprecated_msg(
"Deprecated. Result will most likely contain <SPOKEN_NOISE> word");
168@property(nonatomic, strong, nullable) NSArray<KIOSPhone *> *
phones;
172@property (nonatomic, assign, readonly, getter=isTag) BOOL tag
175- (nonnull NSString *)description;
186@property (nonatomic, readonly, nonnull) NSString *text;
188@property (nonatomic, strong, nullable, readonly) NSNumber *startTime;
190@property (nonatomic, strong, nullable, readonly) NSNumber *duration;
192@property (nonatomic, strong, nullable, readonly) NSNumber *pronunciationScore;
209@protocol KIOSRecognizerDelegate <NSObject>
237- (void)recognizerTriggerPhraseDetectedForRecognizer:(nonnull
KIOSRecognizer *)recognizer
238__deprecated_msg("Please see triggerPhraseDetected");
279- (void)recognizerReadyToListenAfterInterrupt:(nonnull
KIOSRecognizer *)recognizer;
360@property(nonatomic, weak, nullable) id<KIOSRecognizerDelegate>
delegate;
450+ (BOOL)initWithASRBundle:(nonnull NSString *)bundleName;
470+ (BOOL)initWithASRBundleAtPath:(nonnull NSString *)pathToASRBundle;
475+ (nullable instancetype) new __attribute__((unavailable("new not available, call
sharedInstance instead")));
508- (void) setVadGating:(BOOL)value;
527- (BOOL)prepareForListeningWithDecodingGraphWithName:(nonnull NSString *)dgName
528 withGoPComputation:(BOOL)computeGoP;
551- (BOOL)prepareForListeningWithDecodingGraphAtPath:(nonnull NSString *)pathToDecodingGraphDirectory
552 withGoPComputation:(BOOL)computeGoP;
574- (BOOL)prepareForListeningWithContextualDecodingGraphWithName:(nonnull NSString *)dgName
575 andContextId:(nonnull NSNumber *) contextId
576 withGoPComputation:(BOOL)computeGoP;
601- (BOOL)prepareForListeningWithContextualDecodingGraphAtPath:(nonnull NSString *)dgPath
602 andContextId:(nonnull NSNumber *)contextId
603 withGoPComputation:(BOOL)computeGoP;
653- (BOOL)startListening:(NSString *_Nullable*_Nullable) responseId;
695- (void)adaptToSpeakerWithName:(nonnull NSString *)speakerName;
754+ (BOOL)removeSpeakerAdaptationProfiles:(nonnull NSString *)speakerName;
822- (BOOL)performEchoCancellation:(BOOL)value;
831- (void)setBluetoothA2DPOutput:(BOOL)value;
885- (void)setVADParameter:(KIOSVadParameter)parameter toValue:(
float)value;
902+ (void)setLogLevel:(KIOSRecognizerLogLevel)logLevel;
908@property(nonatomic, readonly, nullable) NSString *lastRecordingFilename
909__deprecated_msg(
"Please see KIOSResponse for more details");
911@property(nonatomic, readonly, nullable) NSString *lastJSONMetadataFilename
912__deprecated_msg(
"Please see KIOSResponse for more details");
914- (BOOL)prepareForListeningWithCustomDecodingGraphWithName:(nonnull NSString *)dgName
915__deprecated_msg("Please use prepareForListeningWithDecodingGraphWithName");
917- (BOOL)prepareForListeningWithCustomDecodingGraphAtPath:(nonnull NSString *)pathToDecodingGraphDirectory
918__deprecated_msg("Please use prepareForListeningWithDecodingGraphAtPath");
920- (BOOL)startListeningFromAudioFile:(nonnull NSString *)pathToAudioFile
921__deprecated_msg("Temporarily deprecated; methods to feed audio directly to the recognizer will be provided in the future");
929- (void)enableBluetoothOutput:(BOOL)value __attribute__((deprecated("use setBluetoothA2DPOutput instead")));
931- (void)enableBluetoothA2DPOutput:(BOOL)value __attribute__((deprecated("use setBluetoothA2DPOutput instead")));
Definition KIOSRecognizer.h:186
Definition KIOSRecognizer.h:347
NSString * miscDataDirectory
Definition KIOSRecognizer.h:395
BOOL handleNotifications
Definition KIOSRecognizer.h:787
BOOL removeAllSpeakerAdaptationProfiles()
BOOL deactivateAudioStack()
BOOL echoCancellationAvailable()
nonnull NSString * version()
NSString * asrBundleLang
Language code of the ASR Bundle backing this recognizer.
Definition KIOSRecognizer.h:386
KIOSRecognizerState recognizerState
Definition KIOSRecognizer.h:364
void resetSpeakerAdaptation()
nullable KIOSRecognizer * sharedInstance()
NSString * asrBundleName
Definition KIOSRecognizer.h:373
NSString * recordingsDir
Definition KIOSRecognizer.h:392
NSString * asrBundlePath
Definition KIOSRecognizer.h:368
BOOL activateAudioStack()
BOOL rescore
Definition KIOSRecognizer.h:414
void saveSpeakerAdaptationProfile()
NSString * currentDecodingGraphName
Definition KIOSRecognizer.h:389
id< KIOSRecognizerDelegate > delegate
Definition KIOSRecognizer.h:360
Definition KIOSResponse.h:19
Definition KIOSRecognizer.h:104
nullable NSString * toJSON()
NSString * cleanText
Definition KIOSRecognizer.h:109
NSString * text
Definition KIOSRecognizer.h:106
NSArray< KIOSWord * > * words
Definition KIOSRecognizer.h:112
Definition KIOSRecognizer.h:155
NSString * text
Definition KIOSRecognizer.h:156
BOOL tag __deprecated_msg("Temporarily deprecated")
NSNumber * duration
Definition KIOSRecognizer.h:162
NSNumber * startTime
Definition KIOSRecognizer.h:159
NSArray< KIOSPhone * > * phones
Definition KIOSRecognizer.h:168
void unwindAppAudioBeforeAudioInterrupt()