0

在 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;

}

4

1 回答 1

0

iOS 代码在 LICENSE_INFO 文字中存在空格/换行符问题。您需要做的是用 '\n' (不带引号)替换许可证字符串中的换行符,以便 LICENSE_INFO 只是一个长行。错误应该消失。

我们已使用此说明更新了文档https://developer.gracenote.com/how-build-simple-entourage-application-ios

谢谢,给您带来的不便深表歉意!

于 2014-04-04T22:22:00.933 回答