AcoustID.ChromaContext.DecodeFingerprint C# (CSharp) Méthode

DecodeFingerprint() public static méthode

Uncompress and optionally base64-decode an encoded fingerprint.
public static DecodeFingerprint ( byte encoded_fp, bool base64, int &algorithm ) : int[]
encoded_fp byte Pointer to an encoded fingerprint
base64 bool Whether the encoded_fp parameter contains binary data or base64-encoded /// ASCII data. If 1, it will base64-decode the data before uncompressing the fingerprint.
algorithm int Chromaprint algorithm version which was used to generate the raw /// fingerprint
Résultat int[]
        public static int[] DecodeFingerprint(byte[] encoded_fp, bool base64, out int algorithm)
        {
            string encoded = Base64.ByteEncoding.GetString(encoded_fp);
            string compressed = base64 ? Base64.Decode(encoded) : encoded;

            FingerprintDecompressor decompressor = new FingerprintDecompressor();
            int[] uncompressed = decompressor.Decompress(compressed, out algorithm);

            int size = uncompressed.Length;
            int[] fp = new int[size];
            // TODO: copying necessary?
            Array.Copy(uncompressed, fp, size);

            return fp;
        }