danieltmiles/echolocation — pull request #4 by darshan- (2011-11-21 08:44:51+00:00)
Title: Use left on the left (was accidentally using right); Stop AudioTrack on Service destruction.

The AudioTrack was left open/alive/whatever, which was keeping the PCM hardware from going to sleep, leaving a quiet hissing and periodic (every few seconds) clicking every time it tried and failed to sleep. Calling track.stop() is almost enough, but then the still running/pending TimerTask would use the track, which restarted it, leaving the problem unsolved. Setting `track' to null after stopping it, and testing for null in the TimerTask solves the issue.

There may be a cleaner way, but I couldn't find a way to wait for any active TimerTasks to stop, and this was simple enough.