Android Version

416 views
Skip to first unread message

Albert Volschenk

unread,
Aug 29, 2014, 10:16:52 AM8/29/14
to reco...@googlegroups.com
Hello

I am currently working on an Android application that should implement voice identification. I managed to get the java version to work on my pc. I then started to implement it on Android and because of the libraries that isn't available on Android, I used code from https://gitorious.org/android-user-auth/auth-module-voice/source/4d7f0bb00947f3f624ce9044894582f73ed4e636 which was mention in another topic in this group. 

How my app currently works is it records a wav file onto my device. Then it reads the wav file into a double[] (I used the code from the above link to do that). Then I call the createVoicePrint(K userKey, double[] voiceSample) function. 
Now the problems start, at first the Normalizer threw the following exception: "Expected value for audio are in the range -1.0 <= v <= 1.0 ". 
Then I just commented out the lines and it worked fine. But now when I try and Identify someone the results that I receive isn't the same as when I run it on my computer, it is much more prone to giving false positives. I am using the same wav files, the only difference is how I read in the wav files and the normalizer that doesn't check the range of the values. I think that the problem is with the lines that I commented out to prevent the exception.

So does anyone have any suggestions to get this to work? Maybe there is a way to just scale the values to be between -1 and 1, but I couldn't find a way to do this. Or if there is a way to directly record into a double[] from an Android device then that would be even better.
Are there any other open source projects that I can try to use? I already came across http://marf.sourceforge.net/ and I'm thinking of trying to implement that. But it seems to be a bit more complicated than Recognito is.

Thank you

Amaury Crickx

unread,
Sep 1, 2014, 3:18:34 AM9/1/14
to reco...@googlegroups.com
Hi Albert,

Thanks for trying Recognito!

I'd guess the problem lies in the conversion from wav int to double[]: -1 and +1 are the boundary values, if you have values outside of that range, they'll just mess the algorithm.

There is no file format that would encode the samples in a double[]: it takes way more space and thus is not efficient for storage purpose.

It's because the algorithms for signal analysis rely on trigonometry and radians that this conversion is mandatory. 

I'd recommend looking at the method readAudioInputStream in FileHelper.java in the utils package which does the conversion and implement the same for the android file API. 
The numbers should then match exactly and the normalizer will be just as happy as it was when run on your PC :-)

One thing to note, I'm using the jdk to convert the file encoding to (same sample rate, 16bit, mono, signed int, big endian notation)
Since I guess the Android platform doesn't have an equivalent to convert file formats, I'd force the use of a wav file that has this kind of encoding and throw unsupported file format if that's not the case.
Don't try to implement a converter yourself, you'll end up banging your head against the walls :-) 
Why, oh, why did they allow so many different encodings for digital audio...

Using Marf, you'll hit the same problems as it's also relying on trigonometry formulas with radians and values between -1 and 1.

HTH

Cheers

Amaury

PS: Please consider providing the code back to the community, this is something that'd be useful for other users and would help me greatly in making Recognito Android compatible ;-)
I guess i'd abstract out common code from Recognito.java and create a new Recognito4A (Recognito 4 Android) which supports Android file types 

Khurram Shehzad

unread,
Oct 15, 2014, 3:33:19 AM10/15/14
to reco...@googlegroups.com
Hi Albert,
I am facing the same problem as u do converting .wav to double(Normalizer threw the following exception: "Expected value for audio are in the range -1.0 <= v <= 1.0 ". ).
Have you resolved this issue ??

Or any alternatives to speaker recognition ??

Thank You!

Albert Volschenk

unread,
Oct 18, 2014, 1:24:33 PM10/18/14
to reco...@googlegroups.com
Hi, I did not manage to get recognito to work on Android. But we used another project that was mentioned on this group in another topic. We changed some of the implementation details (auto start/stop recording and we are not recording into a file, we are storing it in a buffer).
Our project has many other features as well, but take a look at the voiceAuthenticator class in the voiceIdent project to see what we did. It uses a MFCC Feature extraction algorithm with a k-means clustering algorithm to train and recognise people's voices.

I hope this helps you out. It would be great if something my team and I did actually contributed to society. Please check out the android-user-auth project that was mention here in another topic to see where I got the original code from

The link to our repository: https://github.com/tinkie101/SmartDoor 

Khurram Shehzad

unread,
Oct 21, 2014, 1:00:35 AM10/21/14
to reco...@googlegroups.com
Hi,
thanks for sharing your project.
i need face recognizer too in my app much needed feature. is there any tutorial you follow for face recognizer ??

Regards:
Khurram Shehzad

brilja...@gmail.com

unread,
Nov 27, 2014, 9:09:49 AM11/27/14
to reco...@googlegroups.com
Has anyone already got Recognito running on Android?
It would be great to use this for my project.

Regards

Op dinsdag 21 oktober 2014 07:00:35 UTC+2 schreef Khurram Shehzad:

krishnas...@gmail.com

unread,
Mar 22, 2017, 6:38:38 AM3/22/17
to Recognito
Hi sir,

I want to make a speaker identification application in android and if the application authenticate the person then it should say welcome to user else invalid credential, but i am not getting how to start it, can you help me to make it possible. and one more thing there is any open source engine and source code available for this project.

Thanks in advance

krishnas...@gmail.com

unread,
Mar 22, 2017, 7:01:31 AM3/22/17
to Recognito
hi Albert,

Could you please tell me how did work with voiceIdent because there are no main avtivity, can you please share some knowledge with me.
'
Thanks in advance

Urvi gola

unread,
Jun 6, 2017, 12:43:59 AM6/6/17
to Recognito
Could you please help me with adding recognito library in my android studio project?  
Reply all
Reply to author
Forward
0 new messages