在iOS中实现Gracenote api的问题提供无效的User&经理没有初始化。
GN_Entourage_Demo [24927:70b] getUserACR:错误:管理器未初始化2014-03-10 19:05:20.509 GN_Entourage_Demo [24927:70b]错误:无效用户(lldb) 我执行时遇到问题
//初始化Entourage SDK self.sdkManager = [[GnSdkManager alloc] initWithLicense:LICENSE_INFO错误:nil];
self.acrUser = [self getUserACR];
if (!self.acrUser) {
NSLog(@"Error: Invalid User");
}
// Create a GnAcr object for this user
self.acr = [[GnACR alloc] initWithUser:self.acrUser error:nil];
// Set up an audio configuration
GnAcrAudioConfig *config =
[[[GnAcrAudioConfig alloc] initWithAudioSourceType:GnAcrAudioSourceMic
sampleRate:GnAcrAudioSampleRate44100
format:GnAcrAudioSampleFormatPCM16
numChannels:1] autorelease];
// Initialize the GnAcr's audio configuration
[self.acr audioInitWithAudioConfig:config];
// Initialize the audio source (i.e. device microphone)
self.audioSource = [[GnAudioSourceiOSMic alloc] initWithAudioConfig:config];
// Assign the delegates
self.audioSource.audioDelegate = self;
self.acr.resultDelegate = self;
self.acr.statusDelegate = self;
self.isListening = NO;
}
答案 0 :(得分:0)
iOS代码在LICENSE_INFO文字中有空白/换行问题。您需要做的是将许可证字符串中的换行符替换为' \ n' (没有引号),所以LICENSE_INFO只是一条长线。错误应该消失。
我们已使用此便笺https://developer.gracenote.com/how-build-simple-entourage-application-ios
更新了文档谢谢,对此给您带来的不便表示歉意!