代码之家  ›  专栏  ›  技术社区  ›  Jatiendar Kumar

Gracenote错误:无效用户

  •  0
  • Jatiendar Kumar  · 技术社区  · 11 年前

    在iOS中实现Gracenote api的问题提供了无效的用户&管理器未初始化。

    GN_Entourage_Demo[24927:70b]getUserACR:错误:管理器未初始化2014-03-10 19:05:20.509 GN_Entouge_Demo[24927:70 b]错误:无效用户(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;
    

    }

    1 回复  |  直到 11 年前
        1
  •  0
  •   cweichen    11 年前

    iOS代码在LICENSE_INFO文本中存在空格/换行符问题。您需要做的是将许可证字符串中的换行符替换为“\n”(不带引号),这样License_INFO就只有一个长行。错误应该会消失。

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

    谢谢,很抱歉给您带来不便!