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

Show Dialog using PendingIntent
camera intent onActivityResult causes application object and activity to re create
how do I set the listView to the ArrayAdapter, Android
Android Google Maps API V2 - Mark area on the map
Google Analytics V2 (GAV2) Easy Tracker sendView not working
Handler sendMessageDelayed works only the first time
Jump to spinner selection
Change keyboard input text in EditText android
Scroll current tab highlight in ViewPagerIndicator
Inaparent java.lang.NullPointerException
Call an activity only once in the app and show it again when the app restart after being killed
Use PullToRefreshExpandableListView in Fragment
Button with dashed outline - 9patch with tileMode=“repeat”?
Expansion Files: Once the expansion files is downloaded start the Intent to next activity
Android GC and AudioTrack, GC thread stuck in dlmalloc_inspect_all and AudioTrack stuck .. tryLock
Source not found: com.android.internal.os.ZygoteInit$MethodAndArgsCaller

Categories

HOME
phantom-dsl
search
porting
developer-tools
c99
apache-flink
wakanda
powerpoint
jmx
aws-cli
parameters
banner
okhttp
little-proxy
text-mining
redis-sentinel
x-cart
endpoint
frequency-distribution
symmetricds
eip
docx
package-managers
symfony-2.8
standards
dimensional-modeling
pyramid
dpdk
roslyn
xunit
data.stackexchange.com
google-cloud-print
has-and-belongs-to-many
browser-sync
xbox
complex-numbers
utorrent
kodi
jmockit
catch-unit-test
android-maps-extensions
gnat-gps
dynamic-jasper
fiware-cygnus
google-earth-engine
z-notation
projects-and-solutions
apache-stanbol
watchface
android-exoplayer
globalize
insight
remedy
stdmap
boxing
sundials
cup
flyout
pocketsphinx-android
cvxpy
smartfoxserver
mapxtreme
macaulay2
stream-processing
cda
fuzzywuzzy
httpruntime.cache
relativelayout
custom-errors
file-move
phonertc
binomial-theorem
text-search
doctype
visual-sourcesafe-2005
apache-commons-daemon
ansi
aspectj-maven-plugin
j-security-check
shopizer
universal-image-loader
mdichild
mintty
dct
scriptaculous
isqlquery
modular
cocoalibspotify-2.0
beaker-testing
dolby-audio-api
pagedown
traceability
asplinkbutton
booksleeve
cakephp-1.2
listitem
multiplexing
predicatebuilder
floating-point-exceptions
hibernateexception
pinch
procedures
drawtobitmap
strsep
eclipse-marketplace
silverlight-oob
ifilter
commercial-application

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