/** * Max time shift between right and left mic in number of samples. * This typically depends on the sample rate and the distance between * microphones.
* You have max_samples_shifts=(dist_between_mic/speed_of_sound) * sample_rate */ int _nbSamplesMaxDiff; /** * sound speed in meters per seconds */ static const float _soundSpeed = 344; /** * Distance between microphones in meters * for PS3 eye: http://www.rrfx.net/2009/11/ps3-eye-4-channel-audio-tests-on-ubuntu.html */ static const float _distanceBetweenMicrophones = 0.062f; SoundSourceLoc() { .... // compute extreme sample diff _nbSamplesMaxDiff = (_distanceBetweenMicrophones/_soundSpeed)*_soundSamplingRate+1; }