C# Class AcoustID.ChromaContext

The main Chromaprint API.
Afficher le fichier Open project: wo80/AcoustID.NET Class Usage Examples

Méthodes publiques

Свойство Type Description
Version string

Méthodes publiques

Méthode Description
ChromaContext ( ) : AcoustID.Audio

Initializes a new instance of the ChromaContext class.

ChromaContext ( AcoustID.Chromaprint.ChromaprintAlgorithm algorithm ) : AcoustID.Audio

Initializes a new instance of the ChromaContext class.

ChromaContext ( AcoustID.Chromaprint.ChromaprintAlgorithm algorithm, IFFTService fftService ) : AcoustID.Audio

Initializes a new instance of the ChromaContext class.

ChromaContext ( IFFTService fftService ) : AcoustID.Audio

Initializes a new instance of the ChromaContext class.

DecodeFingerprint ( byte encoded_fp, bool base64, int &algorithm ) : int[]

Uncompress and optionally base64-decode an encoded fingerprint.

EncodeFingerprint ( int fp, int algorithm, bool base64 ) : byte[]

Compress and optionally base64-encode a raw fingerprint.

Feed ( short data, int size ) : void

Send audio data to the fingerprint calculator.

Finish ( ) : void

Process any remaining buffered audio data and calculate the fingerprint.

GetFingerprint ( ) : string

Return the calculated fingerprint as a compressed string.

GetFingerprintHash ( ) : int

Return 32-bit hash of the calculated fingerprint.

If two fingerprints are similar, their hashes generated by this function will also be similar. If they are significantly different, their hashes will most likely be significantly different as well, but you can't rely on that. You compare two hashes by counting the bits in which they differ. Normally that would be something like POPCNT(hash1 XOR hash2), which returns a number between 0 and 32. Anthing above 15 means the hashes are completely different.

GetRawFingerprint ( ) : int[]

Return the calculated fingerprint as an array of 32-bit integers.

SetOption ( string name, int value ) : bool

Set a configuration option for the selected fingerprint algorithm.

NOTE: DO NOT USE THIS FUNCTION IF YOU ARE PLANNING TO USE THE GENERATED FINGERPRINTS WITH THE ACOUSTID SERVICE. Possible options: - silence_threshold: threshold for detecting silence, 0-32767

Start ( int sample_rate, int num_channels ) : bool

Restart the computation of a fingerprint with a new audio stream

Method Details

ChromaContext() public méthode

Initializes a new instance of the ChromaContext class.
public ChromaContext ( ) : AcoustID.Audio
Résultat AcoustID.Audio

ChromaContext() public méthode

Initializes a new instance of the ChromaContext class.
public ChromaContext ( AcoustID.Chromaprint.ChromaprintAlgorithm algorithm ) : AcoustID.Audio
algorithm AcoustID.Chromaprint.ChromaprintAlgorithm The algorithm to use, see (default = TEST2)
Résultat AcoustID.Audio

ChromaContext() public méthode

Initializes a new instance of the ChromaContext class.
public ChromaContext ( AcoustID.Chromaprint.ChromaprintAlgorithm algorithm, IFFTService fftService ) : AcoustID.Audio
algorithm AcoustID.Chromaprint.ChromaprintAlgorithm The algorithm to use, see (default = TEST2)
fftService IFFTService The FFT service.
Résultat AcoustID.Audio

ChromaContext() public méthode

Initializes a new instance of the ChromaContext class.
public ChromaContext ( IFFTService fftService ) : AcoustID.Audio
fftService IFFTService The FFT service.
Résultat AcoustID.Audio

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[]

EncodeFingerprint() public static méthode

Compress and optionally base64-encode a raw fingerprint.
public static EncodeFingerprint ( int fp, int algorithm, bool base64 ) : byte[]
fp int pointer to an array of 32-bit integers representing the raw fingerprint to be encoded
algorithm int Chromaprint algorithm version which was used to generate the raw fingerprint
base64 bool Whether to return binary data or base64-encoded ASCII data. The /// compressed fingerprint will be encoded using base64 with the URL-safe scheme if you /// set this parameter to 1. It will return binary data if it's 0.
Résultat byte[]

Feed() public méthode

Send audio data to the fingerprint calculator.
public Feed ( short data, int size ) : void
data short raw audio data, should point to an array of 16-bit /// signed integers in native byte-order
size int size of the data buffer (in samples)
Résultat void

Finish() public méthode

Process any remaining buffered audio data and calculate the fingerprint.
public Finish ( ) : void
Résultat void

GetFingerprint() public méthode

Return the calculated fingerprint as a compressed string.
public GetFingerprint ( ) : string
Résultat string

GetFingerprintHash() public méthode

Return 32-bit hash of the calculated fingerprint.
If two fingerprints are similar, their hashes generated by this function will also be similar. If they are significantly different, their hashes will most likely be significantly different as well, but you can't rely on that. You compare two hashes by counting the bits in which they differ. Normally that would be something like POPCNT(hash1 XOR hash2), which returns a number between 0 and 32. Anthing above 15 means the hashes are completely different.
public GetFingerprintHash ( ) : int
Résultat int

GetRawFingerprint() public méthode

Return the calculated fingerprint as an array of 32-bit integers.
public GetRawFingerprint ( ) : int[]
Résultat int[]

SetOption() public méthode

Set a configuration option for the selected fingerprint algorithm.
NOTE: DO NOT USE THIS FUNCTION IF YOU ARE PLANNING TO USE THE GENERATED FINGERPRINTS WITH THE ACOUSTID SERVICE. Possible options: - silence_threshold: threshold for detecting silence, 0-32767
public SetOption ( string name, int value ) : bool
name string option name
value int option value
Résultat bool

Start() public méthode

Restart the computation of a fingerprint with a new audio stream
public Start ( int sample_rate, int num_channels ) : bool
sample_rate int sample rate of the audio stream (in Hz)
num_channels int numbers of channels in the audio stream (1 or 2)
Résultat bool

Property Details

Version public_oe static_oe property

Return the version number of Chromaprint.
public static string Version
Résultat string