在 iOS 中实现 Gracenote api 的问题提供了无效的用户和管理器未初始化。
GN_Entourage_Demo[24927:70b] getUserACR: ERROR: Manager not initialized 2014-03-10 19:05:20.509 GN_Entourage_Demo[24927:70b] Error: Invalid User (lldb) 以下问题在我实施时
// 初始化 Entourage SDK self.sdkManager = [[GnSdkManager alloc] initWithLicense:LICENSE_INFO error: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;
}