- Home /
Read audio/music currently playing on speakers?
Just wondering if there is any way this is possible: I'm working on a visualizer plugin that reads audio data from music playing in an audio listener attached to my scene. Is there any way to read audio already playing on the device's speakers in the background instead(specifically on mobiles, say if the user already had music playing in another background app...., Is there any way to read this audio data in script so that I can pass it to my visualizer or even the audio listener directly?)
I haven't done any work on this before, so I'm offering this just a starting point of you, in case you don't get any more detailed responses.
I think you should familiarize yourself with Android's audio, and particularly the audio-specific framework APIs in android.media:
https://source.android.com/devices/audio/index.html
...and then use Unity's JNI interface to call functions in android.media: