Record Android Audio Output

Seems to be currently there is no way to achieve this.

This is another question related to this : android get device overall audio output in pcm


The closest API available to you for these purposes is Visualizer. Which only captures "partial and low quality audio content".

I imagine direct audio capture functionality is omitted to prevent pro-piracy apps. It may be worth noting that there is a CAPTURE_AUDIO_OUTPUT permission, but it is "Not for use by third-party applications". So if you really do have legitimate apps that are capable of this, as you claim, they are likely system apps. Even if you wrote an app that generated its own musical sequences, for example, you would still have to write your own encoder/decoder to achieve anything close to what you're asking for (and that wouldn't even be considered audio capture at that point.)

To put it bluntly, it's currently impossible without breaking any ToS with Google or your phone provider, and will probably remain so indefinitely.