I have created functionality to record video in my app.
When I play a song, that song is recorded with video and a video file is created, similar to a dubshmash app
There is currently no way to directly record android output without "background noise".
Note that this is a security concern to restrict access to other apps audio output, therefore it is very unlikely that it could be achieved directly.
See this answer