Soundlinks提供了解析含有隐含信息的音频内容的基礎API。
要运行示例项目,克隆仓库,并首先从Example目录中运行pod install
。
在AppDelegate
中,使用Appid和Eventid初始化Soundlinks。
[Soundlinks setAppID:@"appid" andEventId:@"eventid"];
在ViewDidLoad
中设置代理并开始麦克风录音。
[Soundlinks setDelegate:self];
[Soundlinks enable];
停止麦克风,不再录音。
[Soundlinks disable];
当Soundlinks监听到一些内容时,会调用回调。返回的内容封装到一个数组中,使用SLContent解析每个内容。
- (void)soundlinks:(Soundlinks *)soundlinks listenContents:(NSArray *)contentArray {
for (SLContent *content in contentArray) {
NSLog(@"Succeed Get Content: %@ \n %@ \n %@ \n", content.title, content.url, content.image);
// To do with the content
}
}
在Info.plist
中添加App Transport Security设置,并将Allow Arbitrary Loads设置为YES。
iOS
iOS
Foundation
AudioToolbox
AVFoundation
UIKit
QuartzCore
Soundlinks可以通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中
pod 'Soundlinks'
Soundlinks在MIT许可下可用。有关更多信息,请参阅LICENSE文件。