How can you record what's happening on your iPhone? Pretty much like how you can record from Studio Mix what's happening on your PC. Also, how could you take a video of what's happening on your iPhone?
If you are jailbroken, the displayrecorder app captures both video and audio, you can easily transfer to your computer and extract the audio track if you only need the audio.