First time user of echoprint! Need help building and launching echoprint instance

201 views
Skip to first unread message

Ravin Sachdeva

unread,
May 14, 2013, 9:07:58 AM5/14/13
to echo...@googlegroups.com
Dear all,

I recently downloaded and built the echoprint test for android on eclipse but I am unable to run the test case for it. Is there a user manual or step by step instruction to do the same naywhere on this forum?? I am also new to building android applications but want to build a custom app using echoprint. I have been able to build the code and was trying to run the same using android virtual machine through eclipse from the Android SDK.

When I launch the echoprinttest as an android application, I can get to the "test" button on the emulator but it gives me a "Illegal argument exception: Invalid audio buffer size". 

Any help would be greatly apreciated. 

This is the message I am getting on the launch console of eclipse:

[2013-05-14 18:07:41 - EchoprintTest] ------------------------------
[2013-05-14 18:07:41 - EchoprintTest] Android Launch!
[2013-05-14 18:07:41 - EchoprintTest] adb is running normally.
[2013-05-14 18:07:41 - EchoprintTest] Performing edu.gvsu.masl.EchoprintTestActivity activity launch
[2013-05-14 18:07:41 - EchoprintTest] Automatic Target Mode: launching new emulator with compatible AVD 'test'
[2013-05-14 18:07:41 - EchoprintTest] Launching a new emulator with Virtual Device 'test'
[2013-05-14 18:08:02 - EchoprintTest] New emulator found: emulator-5554
[2013-05-14 18:08:02 - EchoprintTest] Waiting for HOME ('android.process.acore') to be launched...
[2013-05-14 18:09:48 - EchoprintTest] HOME is up on device 'emulator-5554'
[2013-05-14 18:09:48 - EchoprintTest] Uploading EchoprintTest.apk onto device 'emulator-5554'
[2013-05-14 18:09:48 - EchoprintTest] Installing EchoprintTest.apk...
[2013-05-14 18:11:33 - EchoprintTest] Success!
[2013-05-14 18:11:33 - EchoprintTest] Starting activity edu.gvsu.masl.EchoprintTestActivity on device emulator-5554
[2013-05-14 18:11:37 - EchoprintTest] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=edu.gvsu.masl/.EchoprintTestActivity }

Errors:

05-14 12:41:42.973: D/gralloc_goldfish(818): Emulator without GPU emulation detected.
05-14 13:04:15.234: E/AudioRecord(818): Unsupported configuration: sampleRate 11025, format 1, channelMask 0x10
05-14 13:04:15.415: D/dalvikvm(818): GC_FOR_ALLOC freed 45K, 7% free 2560K/2728K, paused 94ms, total 109ms
05-14 13:04:15.444: W/System.err(818): java.lang.IllegalArgumentException: Invalid audio buffer size.
05-14 13:04:15.444: W/System.err(818): at android.media.AudioRecord.audioBuffSizeCheck(AudioRecord.java:333)
05-14 13:04:15.454: W/System.err(818): at android.media.AudioRecord.<init>(AudioRecord.java:230)
05-14 13:04:15.454: W/System.err(818): at edu.gvsu.masl.echoprint.AudioFingerprinter.run(AudioFingerprinter.java:166)
05-14 13:04:15.454: W/System.err(818): at java.lang.Thread.run(Thread.java:856)
05-14 13:04:15.454: E/Fingerprinter(818): Invalid audio buffer size.

Wouter Kooij

unread,
May 14, 2013, 10:17:46 AM5/14/13
to echo...@googlegroups.com
The android emulator microphone only supports 8000 hz sampling rate. So to get it working you have to change the variable private final int FREQUENCY too 8000. This will make the error go away, although I have no idea of how this impacts the OTA accuracy.

Ravin Sachdeva

unread,
May 16, 2013, 5:19:05 AM5/16/13
to echo...@googlegroups.com
Hey Wouter,

Thanks for the tip, it cleared the error :)

I can now get to the "listening" part of the application. Can you guide me on how to provide a song for the app to recognize??

Thanks a lot for the help.

Wouter

unread,
May 16, 2013, 5:47:56 AM5/16/13
to echo...@googlegroups.com
AFAIK, If you can get to the listening part you should be able to record a song using the microphone of your PC the emulator is running on. I did not test that however and it might not work because the algorithm isnt built to work with 8Khz sampling rate. The best way would be to connect a real android device to your PC and use that for testing you application. That way you can use the right sampling rate (11025 Hz) that the algorithm requires. From my experience, the matching rate of over the air is rather low though anyway.

Ravin Sachdeva

unread,
May 16, 2013, 9:53:35 AM5/16/13
to echo...@googlegroups.com
hey Wouter,

changed the frequency and installed it on an android device. But the problem now is how do I make it recognize a song? I just press 'Start' and it goes into listening mode till it gets shuts down automatically! shouldnt there be an automatic recognition of the song?? am I missing something??

Thanks for the response!

Wouter

unread,
May 21, 2013, 3:24:13 AM5/21/13
to echo...@googlegroups.com
Hi Ravin,

Did you try it with multiple songs, little background noise and a loud enough volume? Probably the song is not being recognized. Did you check what message you get back from the server (by outputting this to the log for example)? 

Also, did you modify the server address such that it submits a correct request (https://github.com/echonest/EchoprintForAndroid/blob/master/EchoprintLib/src/edu/gvsu/masl/echoprint/AudioFingerprinter.java#L64)? I had to change the fp_code parameter to a "code" parameter and also add a version number in the request.

Wouter

Op donderdag 16 mei 2013 15:53:35 UTC+2 schreef Ravin Sachdeva het volgende:
Reply all
Reply to author
Forward
0 new messages