@Test(expected = NullPointerException.class) public void mergeVoiceSampleThrowsNullPointerExceptionWhenTheUserKeyIsNull() { recognito.mergeVoiceSample(null, voiceSample); }
public VoicePrint mergeVoiceSample(K userKey, double[] voiceSample) { if(userKey == null) { throw new NullPointerException("The userKey is null"); } VoicePrint original = store.get(userKey); if(original == null) { throw new IllegalArgumentException("No voice print linked to this user key [" + userKey + "]"); } double[] features = extractFeatures(voiceSample, sampleRate); synchronized (this) { if(!universalModelWasSetByUser.get()) { universalModel.merge(features); } } original.merge(features); return original; }
Recognito { public VoicePrint mergeVoiceSample(K userKey, double[] voiceSample) { if(userKey == null) { throw new NullPointerException("The userKey is null"); } VoicePrint original = store.get(userKey); if(original == null) { throw new IllegalArgumentException("No voice print linked to this user key [" + userKey + "]"); } double[] features = extractFeatures(voiceSample, sampleRate); synchronized (this) { if(!universalModelWasSetByUser.get()) { universalModel.merge(features); } } original.merge(features); return original; } }
Recognito { public VoicePrint mergeVoiceSample(K userKey, double[] voiceSample) { if(userKey == null) { throw new NullPointerException("The userKey is null"); } VoicePrint original = store.get(userKey); if(original == null) { throw new IllegalArgumentException("No voice print linked to this user key [" + userKey + "]"); } double[] features = extractFeatures(voiceSample, sampleRate); synchronized (this) { if(!universalModelWasSetByUser.get()) { universalModel.merge(features); } } original.merge(features); return original; } Recognito(float sampleRate);  Recognito(float sampleRate, Map<K, VoicePrint> voicePrintsByUserKey); }
Recognito { public VoicePrint mergeVoiceSample(K userKey, double[] voiceSample) { if(userKey == null) { throw new NullPointerException("The userKey is null"); } VoicePrint original = store.get(userKey); if(original == null) { throw new IllegalArgumentException("No voice print linked to this user key [" + userKey + "]"); } double[] features = extractFeatures(voiceSample, sampleRate); synchronized (this) { if(!universalModelWasSetByUser.get()) { universalModel.merge(features); } } original.merge(features); return original; } Recognito(float sampleRate);  Recognito(float sampleRate, Map<K, VoicePrint> voicePrintsByUserKey); VoicePrint getUniversalModel(); synchronized void setUniversalModel(VoicePrint universalModel); synchronized VoicePrint createVoicePrint(K userKey, double[] voiceSample); VoicePrint createVoicePrint(K userKey, File voiceSampleFile); VoicePrint mergeVoiceSample(K userKey, double[] voiceSample); VoicePrint mergeVoiceSample(K userKey, File voiceSampleFile); List<MatchResult<K>> identify(double[] voiceSample); List<MatchResult<K>> identify(File voiceSampleFile); }
Recognito { public VoicePrint mergeVoiceSample(K userKey, double[] voiceSample) { if(userKey == null) { throw new NullPointerException("The userKey is null"); } VoicePrint original = store.get(userKey); if(original == null) { throw new IllegalArgumentException("No voice print linked to this user key [" + userKey + "]"); } double[] features = extractFeatures(voiceSample, sampleRate); synchronized (this) { if(!universalModelWasSetByUser.get()) { universalModel.merge(features); } } original.merge(features); return original; } Recognito(float sampleRate);  Recognito(float sampleRate, Map<K, VoicePrint> voicePrintsByUserKey); VoicePrint getUniversalModel(); synchronized void setUniversalModel(VoicePrint universalModel); synchronized VoicePrint createVoicePrint(K userKey, double[] voiceSample); VoicePrint createVoicePrint(K userKey, File voiceSampleFile); VoicePrint mergeVoiceSample(K userKey, double[] voiceSample); VoicePrint mergeVoiceSample(K userKey, File voiceSampleFile); List<MatchResult<K>> identify(double[] voiceSample); List<MatchResult<K>> identify(File voiceSampleFile);  }