Is it possible for an app to analyze audio being played from another app?

Does the AVFoundation Framework allow an app to have read access of the audio output (e.g. music) that is generated by a different app? If not, can I use the microphone to simultaneously record the audio output of the speaker, and then analyze the microphone recording in real time?


I've read the documentation for "Shared Audio Session of AVAudioSession", and I searched for inter-app audio information, but I still can't determine if this is possible.

I essentially want to write an app that changes screen colors/patterns based on what music is being played by other apps.


Thanks!

Replies

The iOS security sandbox does not allow access to the audio output data produced by other apps unless they first explicitly export such data (for instance, by using the inter-app-audio API).

Howdy all!

Does the Apple Music app make its audio samples available for other apps via the inter-app audio?


I'd like to do some realtime FFT in a custom app from audio as it plays in the Apple Music app. The goal of this is to avoid having to write an interface and supporting software to play music in a library, and also to allow the user to play any music in his or her library without having to import or insert it into the custom app (e.g. want to avoid recreating a similar interface as the Apple Music app).


Thanks,

-Robert

Howdy,


It sounds like there might be some nuggets in MusicKit that would allow this kind of access (hopefully can get the audio samples from it to do the Fast Fourier Transforms (FFT)).


https://affiliate.itunes.apple.com/resources/documentation/apple-music-best-practices-for-app-developers/


Crossing fingers...

-Robert

Howdy,

It is still unclear how the audio samples can be obtained from the media player or related audio subsystem, when using MusicKit.


Thanks a bunch,

-Robert

Things have changed since this thread went up two years ago - rather than tagging it, feel free to start your own so it can receive the unique attention it deserves and you can better track, etc. and close should someone help solve your issue(s), thanks.