应用程序使用手机的Andr​​oid GNSK崩溃时identifyAlbumAsync()audioProcessStart之前被称为() [英] App using Mobile Android GNSK crashes when identifyAlbumAsync() is called before audioProcessStart()

查看:320
本文介绍了应用程序使用手机的Andr​​oid GNSK崩溃时identifyAlbumAsync()audioProcessStart之前被称为()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经被升级到使用新手机的Andr​​oid GNSK的应用程序,但我已经注意到,使用新的MusicID提供流是有点棘手。如果identifyAlbumAsync的方法得到了audioProcessStart方法之前执行(因为这需要在不同的线程中执行),应用程序只是崩溃。在通过Gracenote演示的应用中,audioProcessStart方法是连续运行的,所以没有必要其执行与identifyAlbumAsync方法调用同步。难道它应该被使用的方式?这将是方便,如果当方法不按顺序执行的应用程序没有至少坠毁。此外,在我们的应用程序,我们不希望有audioProcessStart的方法不断地像它在演示应用程序完成的。我们只想运行audioProcessStart的方法,当用户请求标识并在播放歌曲被确定,我们希望通过调用audioProcessStop停止音频处理。有没有一种简单的方法来做到这一点?现在,我们正在其中identifyAlbumAsync运行休眠2秒,以确保在那里被认为在audioProcessStart方法来运行线程有权得到执行时间的线程。预先感谢您的及时答复

I have being upgrading an application to use the new Mobile Android GNSK but I have noticed that using the new MusicID-Stream is a little bit tricky. If the "identifyAlbumAsync" method get executed before the "audioProcessStart" method(since this need to be executed in a different thread), the application just crashes. In the Gracenote Demo application, the "audioProcessStart" method is continuously running so there is no need to synchronize its execution with the "identifyAlbumAsync" method call. Is it the way it is supposed to be used? It will be convenient if the application didn't crashed at least when the methods are not executed in order. Also in our application, we don't want to have the "audioProcessStart" method continuously like it is done in the demo application. We only want to run the "audioProcessStart" method when the user request identification and when the song playing gets identified , we want to stop the audio processing by calling "audioProcessStop". Is there an easy way to do this? Right now, we are getting the Thread where "identifyAlbumAsync" is running to sleep for 2 seconds in order to make sure that the Thread where the "audioProcessStart" method is supposed to run has time to get executed. Thank you in advance for your prompt response

推荐答案

感谢您的反馈,你说得对这一问题。不幸的是,现在睡觉是最好的解决方案。但是,我们在即将到来的版本中添加了一个明确的同步事件的支持,请耐心等待。

Thanks for the feedback, you're right about this issue. Unfortunately right now sleeping is the best solution. But we are adding support for an explicit sync event in an upcoming release, please stay tuned.

这篇关于应用程序使用手机的Andr​​oid GNSK崩溃时identifyAlbumAsync()audioProcessStart之前被称为()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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