Basic information about how the SDKs code function. They start with a call to the Android/Java API that deals with audio recording and playback. From there with a buffer array full of some audio data, it can then be sent to a native code library that is also installed as part of the SDK. These libraries handle the more CPU intensive work such as sifting through the data using various common methods (Goertzel et al) to find audio signals of interest.
This first section shows some of the Android/Java function calls and parameters used.
alphonso
ALPHONSO_VERSION = "2.0.46";
private static final int RECORDER_AUDIO_BYTES_PER_SEC = 16000;
private static final int RECORDER_AUDIO_ENCODING = 2;
private static final int RECORDER_BIG_BUFFER_MULTIPLIER = 16;
private static final int RECORDER_CHANNELS = 16;
private static final int RECORDER_SAMPLERATE_44100 = 44100;
private static final int RECORDER_SAMPLERATE_8000 = 8000;
private static final int RECORDER_SMALL_BUFFER_MULTIPLIER = 4;
public static final byte ACR_SHIFT_186 = (byte) 0;
public static final byte ACR_SHIFT_93 = (byte) 1;
public static final int ACR_SPLIT = 2;
bitsound
VERSION_NAME = "v4.2.2"
public void a(int i) {
try {
this.d = new AudioRecord(6, this.b, 16, 2, i);
if (this.d.getState() == 1) {
try {
this.d.startRecording();
if (this.d.getRecordingState() != 3) {
b.c(a, "Audio recording startDetection fail");
this.d.release();
this.e = false;
return;
}
a(this.d);
this.e = true;
return;
cifrasoft
VERSION_NAME = "1.0.3"
public static final int AUDIO_BUFFER_SIZE_MULTIPLIER = 4;
public static final int AUDIO_THREAD_STOP_TIMEOUT = 3000;
public static final int MAX_EMPTY_AUDIO_BUFFER_SEQUENTIAL_READS = 10;
this.SAMPLE_RATE = 44100;
private int readAudioData(int currentPcmOffset, byte[] pcm) {
AudioRecordService.handler.sendEmptyMessageDelayed(1, 3000);
int result = this.mAudioRecord.read(pcm, currentPcmOffset * 2, this.bufferLength * 2);
AudioRecordService.handler.removeMessages(1);
return result;
}
copsonic
CORE_VERSION = "SonicAuth_CORE_v1.2.2.1";
"signalType": "ULTRASONIC_TONES",
"content" : {
"frequencies" : [ [18000, 20000, "TwoTones"] ]
"signalType": "ZADOFF_CHU",
"content": {
"config": {
"samplingFreq": 44100,
"minFreq": 18000,
"maxFreq": 19850,
"filterRolloff": 0.5,
"totalSignalTime": 0.3,
"nMsgSymbols": 2,
"filterSpan": 8
},
"set": {
"centralFreq": 18925,
"nElemSamples": 36,
"nSymbolElems": 181
dv (dov-e)
VERSION_NAME = "1.1.7"
private void recorderWork() {
if (this.recordingActive) {
int bytesReadNumber = this.myRecorder.read(this.myBuffer, 0, this.myBuffer.length);
if (this.recordingActive) {
DVSDK.getInstance().DVCRxAudioSamplesProcessEvent(this.myBuffer, 0, bytesReadNumber / 2);
}
}
}
fanpictor
VERSION_NAME = "3.2.3"
enum FNPFrequencyBand {
Default,
Low,
High
}
fidzup
a. this.frequency = paramBasicAudioAnalyzerConfig.frequency; // 19000.0f
b. this.samplingFrequency = paramBasicAudioAnalyzerConfig.samplingRate; // 44100.0f
c. this.windowSize = paramBasicAudioAnalyzerConfig.windowSize; // 0x200 (512)
d. /* pulseDuration = 69.66f */
e. this.pulseWidth = Math.round(paramBasicAudioAnalyzerConfig.pulseDuration * (this.samplingFrequency / 1000.0F));
f. this.pulseRatio = paramBasicAudioAnalyzerConfig.pulseRatio; // 32.0f
/* signalSize = 0x20 (32)
g. this.signalPeriodPulses = paramBasicAudioAnalyzerConfig.signalSize;
h. this.bitCounts = paramBasicAudioAnalyzerConfig.bitcounts; // 0xb (11)
paramf.a = 19000.0F;
paramf.b = 44100.0F;
paramf.c = 512;
paramf.d = 69.66F;
paramf.e = 0.33333334F;
paramf.f = ((int)(paramf.d * 32.0F * 3.2F)); // 7133.184
paramf.g = 32;
paramf.h = new int[] { 15, 17, 19, 13, 11, 21, 23, 9, 7, 25, 27 };
fluzo
VERSION = "1.3.001"
this.p = jSONObject.getInt("frame_length_milliseconds");
this.q = jSONObject.getInt("frame_step_milliseconds");
this.r = (float) jSONObject.getDouble("preemphasis_coefficient");
this.s = jSONObject.getInt("num_filters");
this.t = jSONObject.getInt("num_coefficients");
this.u = jSONObject.getInt("derivative_window_size");
instreamatic
VERSION_NAME = "7.16.0"
private static final int BUFFER_SECONDS = 5;
private static int DESIRED_SAMPLE_RATE = 16000;
lisnr
VERSION_NAME = "5.0.1.1";
// LisnrIDTone
public long calculateToneDuration() {
return ((long) (((double) (this.lastIteration + 1)) * 2.72d)) * 1000;
}
// LisnrTextTone
public long calculateToneDuration() {
return (long) (((this.text.length() * 6) * 40) + 1280);
}
// LisnrDataTone
public long calculateToneDuration() {
return (long) (((this.data.length * 6) * 40) + 1280);
}
AudioRecord audioRecord = new AudioRecord(0, d, 16, 2, 131072);
ArrayAudioPlayer.this.audioOutput = new AudioTrack(3, ArrayAudioPlayer.this.samplerate, 4, 2, 16000, 1);
ArrayAudioPlayer.this.audioOutput.play();
int written = 0;
while (!ArrayAudioPlayer.this.threadShouldStop) {
try {
if (ArrayAudioPlayer.this.buffer.getBufferLeftToRead() > 0) {
int size = ArrayAudioPlayer.this.buffer.getBufferLeftToRead();
written += size;
ArrayAudioPlayer.this.audioOutput.write(ArrayAudioPlayer.this.buffer.readFromBuffer(size), 0, size);
} else {
ArrayAudioPlayer.this.threadShouldStop = true;
}
} catch (IOException e) {
e.printStackTrace();
}
moodmedia
getVersion() = "1.2.1";
b = new AudioRecord(5, 44100, 16, 2, Math.max(AudioRecord.getMinBufferSize(44100, 16, 2) * 4, 32768));
this.b = Type.SONIC;
this.b = Type.ULTRASONIC;
if (num.intValue() == 44100 || num.intValue() == 48000)
this.j.setName("Demodulator");
this.k.setName("Decoder");
this.l.setName("HitCounter");
prontoly (sonarax)
VERSION_NAME = "4.2.0";
contentValues.put("time", cVar.a);
contentValues.put("type", cVar.b.name());
contentValues.put(NotificationCompat.CATEGORY_EVENT, cVar.c);
contentValues.put("communication_type", cVar.d);
contentValues.put("sample_rate", cVar.e);
contentValues.put("range_mode", cVar.f);
contentValues.put("data", cVar.g);
contentValues.put("duration", cVar.h);
contentValues.put("count", cVar.i);
contentValues.put("volume", cVar.j);
realitymine
getSdkVersion = "5.1.6";
this.e = AudioRecord.getMinBufferSize(44100, 16, 2);
int i = this.e;
this.d = new byte[i];
this.c = new AudioRecord(1, 44100, 16, 2, i);
redbricklane (zapr)
SDK_VERSION = "3.3.0";
AudioRecord localAudioRecord = new AudioRecord(1, 8000, 16, 2, 122880);
if (localAudioRecord.getState() == 1) {
this.logger.write_log("Recorder initialized", "finger_print_manager");
this.logger.write_log("Recording started", "finger_print_manager");
localAudioRecord.startRecording();
runacr
release = "1.0.4"
int minBufferSize = AudioRecord.getMinBufferSize(11025, 16, 2);
this.K = new AudioRecord(6, 11025, 16, 2, minBufferSize * 10);
shopkick
.field bitDetectThreshold:Ljava/lang/Double;
.field carrierThreshold:Ljava/lang/Double;
.field detectThreshold:Ljava/lang/Double;
.field frFactors:Ljava/lang/String;
.field gapInSamplesBetweenLowFreqAndCalibration:Ljava/lang/Integer;
.field maxFracOfAvgForOne:Ljava/lang/Double;
.field maxIntermediates:Ljava/lang/Integer;
.field minCarriers:Ljava/lang/Integer;
.field noiseThreshold:Ljava/lang/Double;
.field numPrefixBitsRequired:Ljava/lang/Integer;
.field numSamplesToCalibrateWith:Ljava/lang/Integer;
.field presenceDetectMinBits:Ljava/lang/Integer;
.field presenceNarrowBandDetectThreshold:Ljava/lang/Double;
.field presenceStrengthRatioThreshold:Ljava/lang/Double;
.field presenceWideBandDetectThreshold:Ljava/lang/Double;
.field useErrorCorrection:Ljava/lang/Boolean;
.field wideBandPresenceDetectEnabled:Ljava/lang/Boolean;
.field highPassFilterType:Ljava/lang/Integer;
Java_com_shopkick_app_presence_NativePresencePipeline_setDopplerCorrectionEnabledParam
Java_com_shopkick_app_presence_NativePresencePipeline_setHighPassFilterEnabledParam
Java_com_shopkick_app_presence_NativePresencePipeline_setWideBandDetectEnabledParam
Java_com_shopkick_app_presence_NativePresencePipeline_setNumPrefixBitsRequiredParam
Java_com_shopkick_app_presence_NativePresencePipeline_setPresenceDetectNarrowBandDetectThresholdFCParam
Java_com_shopkick_app_presence_NativePresencePipeline_setGapInSamplesBtwLowFreqAndCalibFCParam
Java_com_shopkick_app_presence_NativePresencePipeline_setCarrierThresholdFCParam
Java_com_shopkick_app_presence_NativePresencePipeline_setHighPassFilterTypeHPFParam
signal360 (sonic notify)
VERSION_NAME = "4.90.123";
private static final int BUFFER_SIZE = 131072;
private static final int FREQ_STEPS = 128;
private static final int PAYLOAD_LENGTH = 48;
private static final int READ_BUFFER_SIZE = 16384;
public static final int SAMPPERSEC = 44100;
private static final int STEP_SIZE = 256;
private static final int TIMESTEPS_PER_CHUNK = 64;
private static final int USABLE_LENGTH = 256;
silverpush
String d = "1.1.0";
for (int i : new int[]{4096, 8192}) {
AudioRecord audioRecord = new AudioRecord(1, 44100, 16, 2, i);
if (audioRecord.getState() == 1) {
audioRecord.release();
return i;
}
}
soniccode
getVersion() { return "2.2"; }
// player
float[] decodeLocationFloat = decodeLocationFloat(str);
AudioTrack audioTrack = new AudioTrack(8, 44100, 2, 2, AudioTrack.getMinBufferSize(44100, 2, 2), 1);
this.audioGenerator = new STAudioGenerator();
this.audioGenerator.setAudioTrack(audioTrack);
this.audioGenerator.setAmplitude(this._amplitude);
this.audioGenerator.setBlockTime(this._blockTime);
this.audioGenerator.setFrequencies(decodeLocationFloat);
soundpays
SDK_VERSION = "2.0"
this.a.a(18400.0f, 20000.0f);
this.a.a(new float[]{18475.0f, 18550.0f, 18625.0f, 18700.0f, 18775.0f, 18850.0f, 18925.0f, 19000.0f, 19075.0f, 19150.0f, 19225.0f, 19300.0f, 19375.0f, 19450.0f, 19525.0f, 19600.0f, 19675.0f, 19750.0f, 19825.0f, 19900.0f});
tonetag
String f = "2.1.3"
if (stringBuilder2.matches("^[0-9]{1,5}[.][0-9]{1,2}$"))
this.aY = new AudioRecord(1, 44100, 16, 2, 50000);
private static native void initRecordingNative(int i, int i2, int i3, String str);
private static native void initRecordingUltraToneNative(int i, int i2, String str);
private native void processUltraFreqsNative(double[] dArr, String str);
_8KHZ(40),
_10KHZ(50),
_12KHZ(60),
_14KHZ(70),
_16KHZ(80),
_18KHZ(90);
trillbit
VERSION_NAME = "1.0";
private static final int SAMPLE_RATE = 44100;
private static final String TAG = "AutoToneDetectorClass";
private static final int WINDOW_SIZE = 4096;
private static final int CHUNKS_AFTER_TRIGGER = 23;
private static final int CHUNKS_BEFORE_TRIGGER = 2;
private static final int CHUNK_SIZE = 4096;
this.recorder = new AudioRecord(this.AUDIO_SOURCE, SAMPLE_RATE, 16, 2, 4096);
int recorderState = this.recorder.getState();
Log.i(TAG, "RECORDER STATE : " + String.valueOf(recorderState));
if (recorderState == 1) {
try {
this.recorder.startRecording();
Log.i(TAG, "Recording Started");
startAsyncTasks();
} catch (Exception e) {
e.printStackTrace();
}
}
try {
data = new DataPart("temp.mp3", UploadToServer.this.getDatafromFile(str));
} catch (IOException e) {
e.printStackTrace();
}
params.put("mp3file", data);
return params;
Log.d("V2", "Sending Information to backend");
js.put("Device", Build.MANUFACTURER + " " + Build.MODEL);
js.put("audio_chunks", jsonArr);
js.put("MIC_SRC", "MIC");
js.put("FREQ_PLAYED", "3730");
js.put("MIN_BUFFER", "4096");
int[] original = new int[]{5, 5, 1, 2, 3, 4};