While building a mobile app that plays music for fitness classes, I was asked to add a feature that allows the user to speed up the tempo of the music 0-4% to compensate for some gym stereo systems that play music slower. I'm puzzled because I imagine that for this to occur, the stereo system would need to buffer more and more data over time in order to consistently deliver it at a slower speed. I'm wondering if this is actually a human perception problem, or if there's something else going on that I don't understand. Any ideas?
Your assumption around buffering is incorrect. Any application that plays music out faster or slower will simply change the read-rate of the data to suit the play-out speed. The buffer size will not change. The only thing that will change is the rate at which the buffer is filled up again after being emptied.
Note that this is only possible when reading data off a disk or memory stick or via a remote streaming service where you 'pull' data as required. It will not work with radio/DAB+ etc because the data is being pushed and - like you say - the system would need to continuously buffer more data and would eventually run out of space. Needless to say, this does not and cannot happen. HTH.
There were (possibly still are) stereos that allowed the user to control the speed of playback from digital media as a function directed at karaoke users. These systems often also allowed pitch control independent from the speed.
As Mark says in his answer, the DAC (digital to analogue converter) in some stereos can run at slower or faster clock speeds due to any number of electronic differences - this means that it's reading the digital data slower or faster and therefore converting it to audio slower or faster, regardless of any buffer constraints.
In your case, however, I'm assuming that you're going to be plugging the audio out of the phone (or whatever device the app runs on) into and audio in on the stereo. This means you'll just be passing an audio signal directly to the amplifier so the playback speed of the stereo/hi-fi isn't going to be of any consequence to you.
From an app design standpoint though, you might want to treat this as user feedback and ask some other users if the facility to change playback speed might be useful in the setting of a fitness class.
Some software can upgrade the tempo without altering the pitch (increasing the tempo and the pitch is easier). Typically Reaper (with the Elastique technology), but I guess it is not the only software.
With such a software, you set the tempo coefficient, render it in a WAV or MP3 file and that’s it.