GRACENOTE(GNSDK)的Andr​​oid Wear [英] Gracenote (GNSDK) on Android Wear

查看:245
本文介绍了GRACENOTE(GNSDK)的Andr​​oid Wear的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个Android Wear应用程序,可以识别与Gracenote的GNSDK歌曲。我建立在他们的示例应用程序。

I'm trying to develop an Android Wear app that can identify songs with Gracenote's GNSDK. I'm building upon their sample app.

我在与可穿戴设备上的无线麻烦。示例应用程序是工作在一首歌曲识别尝试方面,而且错过一个互联网连接。 (虽然其他应用程序正常工作。)

I'm having trouble with the Wifi on the wearable device. The sample app is working in terms of a song identification attempt but misses an internet connection. (Although other apps work perfectly.)

那么会发生什么:当手表WiFi和未连接到通过蓝牙连接,而只是通过Wifi它的工作电话。现在通过蓝牙手表将手机连接到手表应该是连接通过手机无线网络。而现在的连接不再可用。因此,通过手机的网络标识不工作。是否有人有什么线索可以是真正的原因以及如何解决?

So what happens: When the watch is in Wifi and not connected to the phone via bluetooth but solely via Wifi it works. Now connecting the phone to the watch via bluetooth the watch is supposed to connect to Wifi through the phone. And now a connection is no longer available. So identifying through the phone's internet is not working. Does anybody have a clue what can be the reason and how to troubleshoot?

如果不是:

有没有一种办法,而不是通过GnMic作出全面鉴定的专辑,从GnMusicIDStream对象只抢了指纹?如果是这样,怎么样?其背后的想法是听经由GnMic可穿戴设备上的歌曲,抓住仅指纹,然后将其发送到移动设备。在那里,做基于指纹识别识别歌曲并把结果发回的手表。

Is there a way to, instead of making a full album identification via GnMic, grab only the fingerprint from the GnMusicIDStream object? And if so, how? The idea behind it is to listen to a song via GnMic on the wearable device, grab only the fingerprint and then send it to the mobile device. There, identify the song by doing an identification based on the fingerprint and send the result back on the watch.

你希望一个人一个想法如何解决这个问题!提前谢谢了!任何帮助AP preciated!

Hope one of you has an idea how to solve the problem! Many thanks in advance! Any help is appreciated!

最佳,
dmkscr

Best, dmkscr

推荐答案

由于与直接从磨损设备访问互联网的局限性,你必须通过在通过其中原始音频字节或指纹手持设备的DataItem MessageApi 。 (请参见 https://developer.android.com/training/wearables/data -layer / index.html的关于这些穿API的信息。)然后,在设备上就可以产生一个指纹和/或提交MusicID提供查询。然后,您需要再次使用的的DataItem MessageApi 以传递结果数据回显示磨损设备。

Due to limitations with accessing the internet directly from a Wear device, you must pass either raw audio bytes or a fingerprint to the handheld device via the DataItem or MessageApi. (See https://developer.android.com/training/wearables/data-layer/index.html for information on these Wear APIs.) Then, on the device you can produce a fingerprint and/or submit a MusicID query. You then need to again use the DataItem or MessageApi to pass result data back to the Wear device for display.

不管采用哪种方法(通过音频字节或指纹到手持设备),你需要在 GnMusicId 类代替 GnMusicIdStream 工作。其原因是, GnMusicIdStream 自动化工作流程的多个步骤(捕获音频,产生指纹,执行基于指纹一MusicID提供查询),并doesn¹t提供单独执行这些挂钩。 GnMusicId 是低层类,让你这个过程的更细粒度的控制。

With either approach (passing audio bytes or a fingerprint to the handheld), you need to work with the GnMusicId class instead of GnMusicIdStream. The reason is that GnMusicIdStream automates multiple steps of workflow (capture audio, produce a fingerprint, perform a MusicID query based on the fingerprint), and doesn¹t provide hooks for performing them separately. GnMusicId is a lower level class that gives you more fine-grained control of this process.

如果您选择将音频数据传送到手持设备,可以使用得到磨损设备上的音频字节 GnMic.getData()。通过传递音频数据字节到手持设备的的DataItem MessageApi 。然后,在手持设备上,
使用以下方法 GnMusicId 以产生指纹,并进行MusicID提供查询:

If you choose to pass the audio data to the handheld, you can get the audio bytes on the Wear device using GnMic.getData(). Pass the audio data bytes to the handheld via DataItem or MessageApi. Then, on the handheld, use the following methods of GnMusicId to produce a fingerprint and perform a MusicID query:


  • fingerprintBegin(GnFingerprintType fpType,长audioSampleRate,长audioSampleSize,长audioChannels)

  • fingerprintWrite(字节[] audioData,长audioDataSize)

  • fingerprintEnd()

  • fingerprintDataGet()

  • findAlbums(java.lang.String中fingerprintData,GnFingerprintType fpType)

  • fingerprintBegin(GnFingerprintType fpType, long audioSampleRate, long audioSampleSize, long audioChannels)
  • fingerprintWrite(byte[] audioData, long audioDataSize)
  • fingerprintEnd()
  • fingerprintDataGet()
  • findAlbums(java.lang.String fingerprintData, GnFingerprintType fpType)

或者,如果你选择产生磨损设备上的指纹,请执行以下操作

Optionally, if you choose to generate the fingerprint on the Wear device, do the following


  • 呼叫 GnMusicId.fingerprintFromSource(IGnAudioSource audioSource,GnFingerprintType fpType)以生成指纹,使用的实例 GnMic 作为 IGnAudioSource

  • 获得通过指纹数据的 GnMusicId.fingerprintDataGet()

  • 通过通过指纹数据到手持设备的的DataItem MessageApi

  • 在手持设备,叫 GnMusicId.findAlbums(java.lang.String中fingerprintData,GnFingerprintType fpType)

  • Call GnMusicId.fingerprintFromSource(IGnAudioSource audioSource, GnFingerprintType fpType) to generate the fingerprint, using an instance of GnMic as the IGnAudioSource.
  • Get the fingerprint data via GnMusicId.fingerprintDataGet()
  • Pass the fingerprint data to the handheld via DataItem or MessageApi
  • On the handheld, call GnMusicId.findAlbums(java.lang.String fingerprintData, GnFingerprintType fpType)

这篇关于GRACENOTE(GNSDK)的Andr​​oid Wear的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆