Capturing audio out in Android and writing as a mp3
According to Subsonic Music Streamer, one of the application features is precisely what you are looking for:


  Songs are cached for offline playback. Supports mp3, ogg, aac, flac, wma. Most video formats supported too.