Using the iPhone’s built in microphone, sound is captured and put through a “chirp detection” algorithm, which figures out the number of chirps in 13 seconds and adds that to 40 to come up with the temperature in fahrenheit. This last part is based on Dolbear’s Law.
And it’s not a joke.
Here’s the link to cricketsong