Package sidplay.fingerprinting
Klasse WhatsSidSupport
java.lang.Object
sidplay.fingerprinting.WhatsSidSupport
WhatsSID? client part of tune recognition.
Use a WhatsSID capture buffer to match a currently played tune. Capture
buffer contains always the last N seconds of sound samples in a ring buffer.
- Autor:
- ken
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate static final intNumber of channels.private final ResamplerResampler to 8Khz.private MusicInfoWithConfidenceBeanLast matchprivate doubleMinimum confidence to detect a matchprivate intState of HP-TPDF.private final RandomRandom source for triangular ditheringprivate ByteBufferCapture buffer.private intCapacity of the capture buffer. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungWhatsSidSupport(double cpuFrequency, int captureTimeInS, double minimumRelativeConfidence) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbyte[]Create WAV sample data form ring-buffer.match(IFingerprintMatcher matcher) Match WhatsSid capture buffer using the given matcherbooleanoutput(int valL, int valR) Output sample data to fill WhatsSid capture buffervoidreset()Reset the capture buffer (call for a new tune to play)private intTriangularly shaped noise source for audio applications.
-
Felddetails
-
CHANNELS
private static final int CHANNELSNumber of channels.- Siehe auch:
-
downSampler
Resampler to 8Khz. -
RANDOM
Random source for triangular dithering -
oldRandomValue
private int oldRandomValueState of HP-TPDF. -
whatsSidBuffer
Capture buffer. -
whatsSidBufferSize
private int whatsSidBufferSizeCapacity of the capture buffer. -
lastWhatsSidMatch
Last match -
minimumRelativeConfidence
private double minimumRelativeConfidenceMinimum confidence to detect a match
-
-
Konstruktordetails
-
WhatsSidSupport
public WhatsSidSupport(double cpuFrequency, int captureTimeInS, double minimumRelativeConfidence)
-
-
Methodendetails
-
output
public boolean output(int valL, int valR) Output sample data to fill WhatsSid capture buffer- Parameter:
valL- left channel sample datavalR- right channel sample data- Gibt zurück:
- capture buffer full
-
match
Match WhatsSid capture buffer using the given matcher- Parameter:
matcher- matcher used to match the capture buffer contents- Gibt zurück:
- matched music info or null (no match)
- Löst aus:
IOException- I/O error
-
reset
public void reset()Reset the capture buffer (call for a new tune to play) -
triangularDithering
private int triangularDithering()Triangularly shaped noise source for audio applications. Output of this PRNG is between ]-1, 1[.- Gibt zurück:
- triangular noise sample
-
createWAV
public byte[] createWAV()Create WAV sample data form ring-buffer.- Gibt zurück:
- WAV bytes
-