C# 클래스 AcoustID.ChromaContext

The main Chromaprint API.
파일 보기 프로젝트 열기: wo80/AcoustID.NET 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Version string

공개 메소드들

메소드 설명
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

메소드 상세

ChromaContext() 공개 메소드

Initializes a new instance of the ChromaContext class.
public ChromaContext ( ) : AcoustID.Audio
리턴 AcoustID.Audio

ChromaContext() 공개 메소드

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)
리턴 AcoustID.Audio

ChromaContext() 공개 메소드

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.
리턴 AcoustID.Audio

ChromaContext() 공개 메소드

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

DecodeFingerprint() 공개 정적인 메소드

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
리턴 int[]

EncodeFingerprint() 공개 정적인 메소드

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.
리턴 byte[]

Feed() 공개 메소드

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)
리턴 void

Finish() 공개 메소드

Process any remaining buffered audio data and calculate the fingerprint.
public Finish ( ) : void
리턴 void

GetFingerprint() 공개 메소드

Return the calculated fingerprint as a compressed string.
public GetFingerprint ( ) : string
리턴 string

GetFingerprintHash() 공개 메소드

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
리턴 int

GetRawFingerprint() 공개 메소드

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

SetOption() 공개 메소드

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
리턴 bool

Start() 공개 메소드

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)
리턴 bool

프로퍼티 상세

Version 공개적으로 정적으로 프로퍼티

Return the version number of Chromaprint.
public static string Version
리턴 string