|
@@ -323,11 +323,10 @@ public class SoundCompareHelper implements PitchDetectionHandler {
|
|
float pitch = pitchDetectionResult.getPitch();
|
|
float pitch = pitchDetectionResult.getPitch();
|
|
int decibel = (int) (100 - Math.abs(silenceDetector.currentSPL()));
|
|
int decibel = (int) (100 - Math.abs(silenceDetector.currentSPL()));
|
|
|
|
|
|
- int byteIndex = (int) (audioEvent.getTimeStamp()*(SoundCompareHandler.soundCompareConfig.audioFormat.getFrameSize()*SoundCompareHandler.soundCompareConfig.audioFormat.getFrameRate()));
|
|
|
|
- byte byteOne = audioEvent.getByteBuffer()[byteIndex];
|
|
|
|
- byte byteTwo = audioEvent.getByteBuffer()[byteIndex + 1];
|
|
|
|
|
|
+ byte byteOne = audioEvent.getByteBuffer()[0];
|
|
|
|
+ byte byteTwo = audioEvent.getByteBuffer()[1];
|
|
|
|
|
|
- double amplitude = ((byteOne&0x000000FF)|(byteTwo<<8));
|
|
|
|
|
|
+ double amplitude = Math.abs(((byteOne&0x000000FF)|(byteTwo<<8)));
|
|
|
|
|
|
if(decibel <= SoundCompareHandler.soundCompareConfig.validDb){
|
|
if(decibel <= SoundCompareHandler.soundCompareConfig.validDb){
|
|
pitch = -1;
|
|
pitch = -1;
|