Voice enrollment

General information about Neurotechnology and its software

Voice enrollment

Postby sumit » Mar 15, 2018 10:29

Hi,
I am using Neurotec_Biometric_10_0_SDK_Trial version.
I am trying to enroll Voice from an in-memory byte[] array.
My enrollment code is as below :

Code: Select all
   
   voice.setSampleBuffer(NFile.readAllBytes(fileName));
   subject.getVoices().add(voice);
   NBiometricStatus status = biometricClient.createTemplate(subject);


But while executing I am getting below error:

Code: Select all

java.lang.RuntimeException: One or more errors occurred
   at com.neurotec.lang.NResult.checkAll(NResult.java:313)
   at com.neurotec.lang.NResult.raiseError(NResult.java:323)
   at com.neurotec.lang.NResult.check(NResult.java:224)
   at com.neurotec.biometrics.NBiometricEngine.createTemplate(NBiometricEngine.java:342)
   at com.dtt.sample.voice.EnrollVoiceFromAudioFile.main(EnrollVoiceFromAudioFile.java:63)
Caused by: com.neurotec.util.concurrent.NAggregateExecutionException: One or more errors occurred
   at com.neurotec.util.concurrent.ConcurrentUtilErrorCreator.create(ConcurrentUtilErrorCreator.java:17)
   at com.neurotec.lang.ChainedErrorCreator.create(ChainedErrorCreator.java:22)
   at com.neurotec.lang.NError.get(NError.java:174)
   at com.neurotec.lang.NError.get(NError.java:191)
   at com.neurotec.lang.NError.getLast(NError.java:205)
   at com.neurotec.lang.NResult.checkUnchecked(NResult.java:235)
   ... 4 more
Caused by: com.neurotec.lang.NUnsupportedOperationException: NSoundBuffer reading from non-WAVE stream is not supported
   at com.neurotec.lang.RuntimeErrorCreator.create(RuntimeErrorCreator.java:42)
   at com.neurotec.lang.ChainedErrorCreator.create(ChainedErrorCreator.java:22)
   at com.neurotec.lang.NError.get(NError.java:174)
   at com.neurotec.lang.NError.get(NError.java:168)
   ... 7 more



If I enroll voice by specifying audio file name as shown below then enrollment is working fine.
Code: Select all
   voice.setFileName(fileName);
   subject.getVoices().add(voice);
   NBiometricStatus status = biometricClient.createTemplate(subject);


But for my requirement, I have an audio data in byte[] format.
Please let me know if i am trying wrong steps or if there is any other way to enroll voice available in byte[] format.


Thanks
Sumit
sumit
 
Posts: 4
Joined: Jan 06, 2015 07:30

Re: Voice enrollment

Postby vaidasz » Mar 16, 2018 12:12

sumit wrote:Hi,
I am using Neurotec_Biometric_10_0_SDK_Trial version.
I am trying to enroll Voice from an in-memory byte[] array.
My enrollment code is as below :

Code: Select all
   
   voice.setSampleBuffer(NFile.readAllBytes(fileName));
   subject.getVoices().add(voice);
   NBiometricStatus status = biometricClient.createTemplate(subject);


But while executing I am getting below error:

Code: Select all

java.lang.RuntimeException: One or more errors occurred
   at com.neurotec.lang.NResult.checkAll(NResult.java:313)
   at com.neurotec.lang.NResult.raiseError(NResult.java:323)
   at com.neurotec.lang.NResult.check(NResult.java:224)
   at com.neurotec.biometrics.NBiometricEngine.createTemplate(NBiometricEngine.java:342)
   at com.dtt.sample.voice.EnrollVoiceFromAudioFile.main(EnrollVoiceFromAudioFile.java:63)
Caused by: com.neurotec.util.concurrent.NAggregateExecutionException: One or more errors occurred
   at com.neurotec.util.concurrent.ConcurrentUtilErrorCreator.create(ConcurrentUtilErrorCreator.java:17)
   at com.neurotec.lang.ChainedErrorCreator.create(ChainedErrorCreator.java:22)
   at com.neurotec.lang.NError.get(NError.java:174)
   at com.neurotec.lang.NError.get(NError.java:191)
   at com.neurotec.lang.NError.getLast(NError.java:205)
   at com.neurotec.lang.NResult.checkUnchecked(NResult.java:235)
   ... 4 more
Caused by: com.neurotec.lang.NUnsupportedOperationException: NSoundBuffer reading from non-WAVE stream is not supported
   at com.neurotec.lang.RuntimeErrorCreator.create(RuntimeErrorCreator.java:42)
   at com.neurotec.lang.ChainedErrorCreator.create(ChainedErrorCreator.java:22)
   at com.neurotec.lang.NError.get(NError.java:174)
   at com.neurotec.lang.NError.get(NError.java:168)
   ... 7 more



If I enroll voice by specifying audio file name as shown below then enrollment is working fine.
Code: Select all
   voice.setFileName(fileName);
   subject.getVoices().add(voice);
   NBiometricStatus status = biometricClient.createTemplate(subject);


But for my requirement, I have an audio data in byte[] format.
Please let me know if i am trying wrong steps or if there is any other way to enroll voice available in byte[] format.


Thanks
Sumit


Hello Sumit,

I tried the same code and it worked just fine.
Anyway, the exception message returned says "NSoundBuffer reading from non-WAVE stream is not supported". So it seems you are trying to use some other but wav format.
Vaidas Z
Neurotechnology
vaidasz
Neurotechnology
 
Posts: 580
Joined: Apr 30, 2010 06:57
Location: Vilnius, Lithuania


Return to Public

Who is online

Users browsing this forum: No registered users and 2 guests

cron