Background Audio on Mobile Devices
The subject disclosure is directed towards a technology in which a mobile device service plays background audio as instructed by a third party audio player application. The service continues to play background audio after the audio player application is deactivated from the foreground, e.g., as another application becomes the foreground application. Also described is launching agents to obtain additional information and/or to handle custom audio formats, and handling of user requests from a universal (system) volume control or the audio player application (when in the foreground).
1 . In a computing environment, a system comprising, a media service configured to play audio in a background process on a mobile device, an interface set by which an application when in the foreground communicates with the media service, the application communicating information via the interface to the media service that corresponds to audio data to play, the media service configured to act upon requests directed towards the audio playback as the media service plays background audio.
2 . The system of claim 1 wherein the application provides a uniform resource identifier to the media service as the information that corresponds to audio data to play.
3 . The system of claim 1 wherein the media service operates to launch an agent that provides at least one of the requests directed towards the audio playback.
4 . The system of claim 1 further comprising a universal volume control component that provides at least one of the requests directed towards the audio playback.
5 . The system of claim 4 wherein the application, when in the foreground, provides information that determines the operation of the universal volume control component.
6 . The system of claim 4 wherein the media service provides information that is presented on a user interface of the universal volume control component.
7 . The system of claim 1 further comprising a source agent, the source agent configured to output audio data that the media service processes into the audio playback, the source agent using a codec, decryption mechanism, decompression mechanism, or a proprietary protocol, or any combination of a codec, decryption mechanism, decompression mechanism, or a proprietary protocol to provide the audio data.
8 . The system of claim 7 wherein the source agent is configured to output the audio data to a shared memory for processing.
9 . The system of claim 1 wherein the information that corresponds to audio data to play is associated with a control flag, the control flag comprising data that indicates via one or more attributes whether the media service is allowed to take a particular action with respect to the audio playback.
10 . The system of claim 9 wherein the control flag includes a set of one or more attributes, the set including an attribute for a skip next action, a skip previous action, a fast forward action, a pause action, or a rewind action, or any combination of attributes for a skip next action, a skip previous action, a fast forward action, a pause action, or a rewind action.
11 . The system of claim 1 wherein the requests directed towards the audio playback correspond to user actions, and include play, pause, skip, stop, skip next, skip previous, seek, fast forward, rewind, rating-related actions, shuffle or repeat, or any combination of play, pause, skip, stop, skip next, skip previous, seek, fast forward, rewind, rating-related actions, shuffle or repeat.
12 . The system of claim 1 wherein the media service acts upon requests directed towards the audio playback by returning state information, the state information including playing, paused, stopped, fast forwarding, rewinding, buffering started, buffering stopped, track ready or track ended, or any combination of playing, paused, stopped, fast forwarding, rewinding, buffering started, buffering stopped, track ready or track ended.
13 . The system of claim 1 wherein the media service is coupled to a playback queue that maintains a playlist of a plurality of audio tracks.
14 . In a computing environment, a method performed at least in part on at least one processor, comprising, communicating audio track information to a media service from an audio application operating as a foreground application of a computing device, obtaining audio data corresponding to the audio track information, closing the foreground application, processing the audio data in the media service to play the audio track, including as background audio while another foreground application is running.
15 . The method of claim 14 further comprising, taking action to launch an agent to obtain additional audio track information.
16 . The method of claim 14 further comprising, providing information provided by the application or the agent, or both, to a universal volume control component for presenting output corresponding to the information via a user interface of the universal volume control component.
17 . The method of claim 14 further comprising, taking action to launch a source agent, the source agent configured to process non-native audio formatted data into native audio data that is processed to play the audio track.
18 . One or more computer-readable media having computer-executable instructions, which when executed perform steps, comprising:
running an audio user interface application as a foreground application on a mobile device;
communicating information from the audio user interface application via a background audio service interface to a media service, the information directed towards playing at least one audio track; and
processing audio data corresponding to the at least one audio track in the media service to provide audio for output, including after the audio user interface application is deactivated.
19 . The one or more computer-readable media of claim 18 having further computer-executable instructions comprising, outputting an audible signal corresponding to the audio via the mobile device, receiving a telephone call attempt on the mobile device, and mixing a ringtone with the audible signal until the call attempt ends.
20 . The one or more computer-readable media of claim 18 having further computer-executable instructions comprising, running a source agent to process non-native audio data into the audio data processed by the media service.