Class Model

java.lang.Object
com.vivoka.vsdk.biometrics.Model

public abstract class Model extends Object
Abstract class representing a biometric model.
  • Field Details

    • _name

      protected final String _name
    • _type

      protected final ModelType _type
    • _enrollmentModelPath

      protected String _enrollmentModelPath
  • Constructor Details

  • Method Details

    • release

      protected abstract void release() throws Exception
      Throws:
      Exception
    • getName

      public String getName()
      Returns:
      The name of the model.
    • getType

      public ModelType getType()
      Returns:
      The type of the model TEXT_DEPENDANT or TEXT_INDEPENDANT.
    • getEnrollmentModelPath

      public final String getEnrollmentModelPath()
      Returns:
      The path of the enrollment model.
    • addRecords

      public void addRecords(String name, List<Buffer> buffer) throws Exception
      Add records from a list of buffers to the model for a specific user. You will need to call compile() to compile and save the model.
      Parameters:
      name - The name of the user.
      buffer - The buffer of the record.
      Throws:
      Exception - If there is an error adding the records.
    • addRecord

      public abstract void addRecord(String name, String path) throws Exception
      Add a record from file to the model for a specific user. You will need to call compile() to compile and save the model.
      Parameters:
      name - The name of the user.
      path - The path of the raw audio file.
      Throws:
      Exception - If there is an error adding the record.
    • addRecord

      public abstract void addRecord(String name, Buffer buffer) throws Exception
      Add a record from a buffer to the model for a specific user. You will need to call compile() to compile and save the model.
      Parameters:
      name - The name of the user.
      buffer - The buffer of the record.
      Throws:
      Exception - If there is an error adding the record.
    • eraseUser

      public abstract void eraseUser(String name) throws Exception
      Erase a user from the model. Doesn't require you to call compile().
      Parameters:
      name - The name of the user.
      Throws:
      Exception - If there is an error erasing the user.
    • compile

      public abstract void compile() throws Exception
      Compile the model and save it.
      Throws:
      Exception - If there is an error compiling the model.
    • getUsers

      public abstract ArrayList<String> getUsers() throws Exception
      Get the list of users in the model.
      Returns:
      The list of users in the model.
      Throws:
      Exception - If there is an error getting the users.
    • analyseRecord

      public abstract android.util.Pair<Boolean,org.json.JSONObject> analyseRecord(String path) throws Exception
      Analyse a record from a file.
      Parameters:
      path - The path of the raw audio file to analyse.
      Returns:
      The result of the analysis. The boolean value of the pair indicates whether the record is acceptable or not. The JSON object contains the analysis result.
      Throws:
      Exception - If there is an error analysing the record.
    • analyseRecord

      public abstract android.util.Pair<Boolean,org.json.JSONObject> analyseRecord(Buffer buffer) throws Exception
      Analyse a record from a buffer.
      Parameters:
      buffer - The buffer to analyse.
      Returns:
      The result of the analysis. The boolean value of the pair indicates whether the record is acceptable or not. The JSON object contains the analysis result.
      Throws:
      Exception - If there is an error analysing the record.