DMSAudioCaptureReader
@interface DMSAudioCaptureReader : DMSCaptureReader
The audio capture reader interface is ideal for real-time capture from an audio source such as a microphone. It vends a captureOutput that can be hooked to an existing AVFoundation capture tree. An audio capture reader will automatically perform buffering and optimization necessary for a capture source. For situations in which a developer wants to have deeper control of how audio is buffered or staged for detection, the synchronous audio reader interface should be used.
-
Custom initializer for a new image reader for the given symbologies.
Declaration
Objective-C
- (nullable instancetype) initWithSymbologies:(DMSSymbologies)symbologies options:(nonnull NSDictionary<DMSReaderOptionKey, id> *)options error:(NSError *_Nullable *_Nullable)error;Swift
init(symbologies: Symbologies, options: [ReaderOptionKey : Any] = [:]) throwsParameters
symbologiesThe set of symbologies the reader should attempt to detect. This is defined by the DMSSymbology set.
optionsA dictionary of options for the reader.
errorAn error returned by this function. Typically returned if a set of options is inconsistent, or if the current or supplied license key is invalid.
Return Value
Returns a new audio detector. May return nil.
-
Designated initializer for a new image reader for the given symbologies.
Declaration
Objective-C
- (nullable instancetype) initWithSymbologies:(DMSSymbologies)symbologies options:(nonnull NSDictionary<DMSReaderOptionKey, id> *)options APIKey:(nullable NSString *)APIKey error:(NSError *_Nullable *_Nullable)error;Swift
init(symbologies: Symbologies, options: [ReaderOptionKey : Any] = [:], apiKey APIKey: String?) throwsParameters
symbologiesThe set of symbologies the reader should attempt to detect. This is defined by the DMSSymbology set.
optionsA dictionary of options for the reader.
APIKeyCustom API key to use. Will override any other currently set API key.
errorAn error returned by this function. Typically returned if a set of options is inconsistent, or if the current or supplied license key is invalid.
Return Value
Returns a new audio detector. May return nil.
-
Sets the delegate to deliver results to.
Declaration
Objective-C
- (void)setResultsDelegate: (nullable NSObject<DMSAudioCaptureReaderResultsDelegate> *)delegate queue:(nullable dispatch_queue_t)queue;Swift
func setResultsDelegate(_ delegate: (any AudioCaptureReaderResultsDelegate)?, queue: dispatch_queue_t?)Parameters
delegateA delegate to deliver results to.
queueThe queue to return results onto. Applications that need to do UI tasks in response to a detection may want to pass the main queue. If delegate is not nil, passing nil for this argument will cause an exception. If delegate is nil, this argument may be ignored.
-
Returns the results delegate. Will be nil if a delegate has not been set.
Declaration
Objective-C
@property (weak, readonly, nullable) NSObject<DMSAudioCaptureReaderResultsDelegate> *resultsDelegate;Swift
weak var resultsDelegate: (any AudioCaptureReaderResultsDelegate)? { get } -
Returns the queue results will be delivered on. Will be nil if a queue has not been set.
Declaration
Objective-C
@property (readonly, nullable) dispatch_queue_t resultsQueue;Swift
var resultsQueue: dispatch_queue_t? { get }
-
The symbologies to use for detection
Declaration
Objective-C
@property (readonly) DMSSymbologies symbologies;Swift
var symbologies: Symbologies { get } -
Sets symbologies and reader options.
Declaration
Objective-C
- (BOOL)setSymbologies:(DMSSymbologies)symbologies options:(nonnull NSDictionary<DMSReaderOptionKey, id> *)options error:(NSError *_Nullable *_Nullable)error;Swift
func setSymbologies(_ symbologies: Symbologies, options: [ReaderOptionKey : Any] = [:]) throwsParameters
symbologiesSymbologies to configure the reader to detect.
optionsOptions to configure the reader with.
errorAn error resulting from setting symbologies, if any.
-
Resets the reader to its default state. Any previously detected payloads will be reported as new payloads again.
Declaration
Objective-C
- (void)reset;Swift
func reset()
DMSAudioCaptureReader Class Reference