Class AudioDB

  • All Implemented Interfaces:
    kotlin.collections.Iterable

    
    public final class AudioDB
     implements Iterable<AudioDB.Entry>
                        

    AudioDB is a database for storing and managing audio entries. Provides methods for adding, removing, replacing, iterating, and matching audio entries.

    • Constructor Detail

      • AudioDB

        AudioDB()
    • Method Detail

      • add

         final Unit add(AudioEntry entry)

        Adds an audio entry to the database.

        Parameters:
        entry - The entry to add.
      • removeByName

         final Boolean removeByName(String name)

        Removes an entry by name.

        Parameters:
        name - The name of the entry to remove.
        Returns:

        true if successful, false otherwise.

      • replaceByName

         final Boolean replaceByName(String name, AudioEntry entry)

        Replaces an entry by name.

        Parameters:
        name - The name of the entry to replace.
        entry - The new entry.
        Returns:

        true if successful, false otherwise.

      • dump

         final Unit dump(BufferedOutputStream bos, Integer op, Boolean skipFooter)

        Dumps the database to an output stream with an option to skip the footer.

        Parameters:
        bos - The output stream.
        op - The operation code.
        skipFooter - Whether to skip the footer.
      • loadFromFile

         final Unit loadFromFile(String filePath)

        Loads the database from a file.

        Parameters:
        filePath - The path to the file.
      • match

         final Array<AudioDB.MatchResult> match(ByteArray hash, Integer pos, Integer len, Integer nresults)

        Matches an audio hash against the database.

        Parameters:
        hash - The audio hash.
        pos - The position in the hash.
        len - The length of the hash.
        nresults - The number of results to return.
        Returns:

        An array of match results.