The United States Patent Office recently published a patent filing from July 2007 that reveals Apple has been working on an ambient sound sensor system that could automatically adjust speaker volume based on it's surrounding environment.
The patent, which is credited to Peter Mahowald, states that a sound sensor such as a microphone, can be used to determine the ambient noise level and adjust a devices sound output accordingly. For example, if a user goes from a noisy environment to a quiet room the device could automatically lower the speaker volume to a more reasonable level.
The auto-adjusting sound could also be overridden by the user. The patent application goes on to describe that the device would also include a learning component that would monitor when a user overrides the device's automatic settings and would later adjust its settings based on the user's actions.
We have yet to see this technology in any of Apple's mobile devices. Many of the patent filings we see from Apple rarely come to fruition but Apple already employs an ambient light sensor in all of there mobile devices so there is still a glimpse of hope.