android


App using Mobile Android GNSK crashes when identifyAlbumAsync() is called before 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.
In the upcoming 1.2 release, IGnMusicIdStreamEvents includes a callback that signals audio-processing has started, and an ID can be synced with this, e.g.:
#Override
public void musicIdStreamProcessingStatusEvent( GnMusicIdStreamProcessingStatus status, IGnCancellable canceller ) {
if (GnMusicIdStreamProcessingStatus.kStatusProcessingAudioStarted.compareTo(status) == 0) {
try {
gnMusicIdStream.identifyAlbumAsync();
} catch (GnException e) { }
}
}

Related Links

Using IN in Content Provider
Can we get the cell tower location of unregistered network android?
how to disable a row of listview in android?
OnclickListener in a Dialog Android
buffer and play videos faster in VideoView
multiple spinner android depend on each other
Android get fit bit user profile
ASP.Net Identity Web API 2 Facebook authentication
Gradle: No resource type specified (at 'text' with value '#{user.name}'). Databinding not working
cordova-plugin-device-motion Exception in start() method
Quickblox SDK 2.5.2 - Incoming call is not receive issue in Android
How to get Google play services back to work with new Genymotion 2.7.2?
SharedPreferences value returning null after new instance
How to prevent the calls to onCreate/onCreateView methods if the activity is finishing
Duplicated “IInAppBillingService.aidl” File - Library + App
Get additions/deletions/edits to the Google Fit database since X time

Categories

HOME
apache-jena
redux-form
pclxl
vscode-extensions
r-googlesheets
square
python-multithreading
mvc5
odoo-8
teechart
sendgrid-api-v3
owin
ipmitool
spring-social
google-form
supervisor
comsol
atlassian
firefox-addon
html5-appcache
sse
database-connection
visual-glitch
imagemap
ember-cli
roslyn
pchart
monit
interpreter
slidetoggle
fractions
alm
powershell-ise
turfjs
hunspell
nested-lists
servicestack-text
openerp-7
alphabetical
diacritics
microsoft-metro
knime
snapchat
vaadin-elements
jquery-ui-draggable
arq
compiler-design
mouseleave
d3-force-directed
baidu
simplepie
redistributable
reporting-services-2012
envi
mongodb-php
tooleap
fink
user-management
inf
character-replacement
boomerang
oracle-spatial
jdi
text-search
vacuum
google-refine
phpldapadmin
java-security
openbabel
spy++
cbind
trdion2011
mdichild
reflector
live555
paste
synapse
high-resolution
printdialog
traceability
pyunit
apache-whirr
window-decoration
ilasm
ikimagebrowserview
android-holo-everywhere
lr
entitydatasource
timthumb
dataform
instantiationexception
object-database
build-environment
leader
netbeans6.1

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App