|
| 1 | +// |
| 2 | +// ACRCloud_Config.h |
| 3 | +// ACRCloud_IOS_SDK |
| 4 | +// |
| 5 | +// Created by olym on 15/3/25. |
| 6 | +// Copyright (c) 2015年 ACRCloud. All rights reserved. |
| 7 | +// |
| 8 | + |
| 9 | +#import <Foundation/Foundation.h> |
| 10 | + |
| 11 | +typedef enum { |
| 12 | + rec_mode_remote = 0, //query remote db |
| 13 | + rec_mode_local = 1, //query local db |
| 14 | + rec_mode_both = 2, // query both remote db and local db |
| 15 | + rec_mode_advance_remote = 3 //query remote db and saving recording fingerprint when offline. |
| 16 | +}ACRCloudRecMode; |
| 17 | + |
| 18 | +typedef enum { |
| 19 | + rec_data_audio = 0, //rec audio data |
| 20 | + rec_data_humming = 1, //rec humming data |
| 21 | + rec_data_both = 2 //rec both |
| 22 | +}ACRCloudRecData; |
| 23 | + |
| 24 | +typedef enum { |
| 25 | + result_type_error = -1, |
| 26 | + result_type_none = 0, |
| 27 | + result_type_audio = 1, |
| 28 | + result_type_live = 2, |
| 29 | + result_type_audio_live = 3, |
| 30 | +}ACRCloudResultType; |
| 31 | + |
| 32 | +typedef enum { |
| 33 | + http_resume_type_error = -1, |
| 34 | + http_resume_type_resume = 0, |
| 35 | + http_resume_type_restart = 1, |
| 36 | + http_resume_type_success = 2, |
| 37 | +} HTTPResumeType; |
| 38 | + |
| 39 | +#define ACRCLOUD_VERSION @"1.0" |
| 40 | + |
| 41 | + |
| 42 | +typedef void(^ACRCloudResultBlock)(NSString *result, ACRCloudResultType resMode); |
| 43 | +typedef void(^ACRCloudResultWithFpBlock)(NSString *result, NSData *fingerprint); |
| 44 | +typedef void(^ACRCloudResultWithDataBlock)(NSString *result, NSData *data); |
| 45 | + |
| 46 | +typedef void(^ACRCloudStateBlock)(NSString *state); |
| 47 | + |
| 48 | +typedef void(^ACRCloudVolumeBlock)(float volume); |
| 49 | + |
| 50 | +@interface ACRCloudConfig : NSObject |
| 51 | +{ |
| 52 | + NSString *_accessKey; |
| 53 | + NSString *_accessSecret; |
| 54 | + NSString *_host; |
| 55 | + NSString *_audioType; |
| 56 | + NSString *_homedir; |
| 57 | + NSString *_uuid; |
| 58 | + NSString *_protocal; |
| 59 | + NSDictionary *_params; |
| 60 | + ACRCloudRecMode _recMode; |
| 61 | + ACRCloudRecData _recDataType; |
| 62 | + NSInteger _requestTimeout; |
| 63 | + NSInteger _prerecorderTime; |
| 64 | + NSInteger _keepPlaying; |
| 65 | + NSUInteger _audioSessionCategory; //default 1, support bluetooth and airplay |
| 66 | + ACRCloudResultBlock _resultBlock; |
| 67 | + ACRCloudStateBlock _stateBlock; |
| 68 | + ACRCloudVolumeBlock _volumeBlock; |
| 69 | + ACRCloudResultWithFpBlock _resultFpBlock; |
| 70 | + ACRCloudResultWithDataBlock _resultDataBlock; |
| 71 | +} |
| 72 | + |
| 73 | +@property(nonatomic, retain) NSString *accessKey; |
| 74 | +@property(nonatomic, retain) NSString *accessSecret; |
| 75 | +@property(nonatomic, retain) NSString *host; |
| 76 | +@property(nonatomic, retain) NSString *audioType; |
| 77 | +@property(nonatomic, retain) NSString *homedir; |
| 78 | +@property(nonatomic, retain) NSString *uuid; |
| 79 | +@property(nonatomic, retain) NSString *protocol; |
| 80 | +@property(nonatomic, retain) NSDictionary *params; |
| 81 | +@property(nonatomic, assign) ACRCloudRecMode recMode; |
| 82 | +@property(nonatomic, assign) ACRCloudRecData recDataType; |
| 83 | +@property(nonatomic, assign) NSInteger requestTimeout; |
| 84 | +@property(nonatomic, assign) NSInteger prerecorderTime; |
| 85 | +@property(nonatomic, assign) NSInteger keepPlaying; |
| 86 | +@property(nonatomic, assign) NSUInteger audioSessionCategory; |
| 87 | +@property(nonatomic, copy) ACRCloudResultBlock resultBlock; |
| 88 | +@property(nonatomic, copy) ACRCloudStateBlock stateBlock; |
| 89 | +@property(nonatomic, copy) ACRCloudVolumeBlock volumeBlock; |
| 90 | +@property(nonatomic, copy) ACRCloudResultWithFpBlock resultFpBlock; |
| 91 | +@property(nonatomic, copy) ACRCloudResultWithDataBlock resultDataBlock; |
| 92 | + |
| 93 | +@end |
0 commit comments