Possible to access/monitor tvOS system audio output? - ios

I'd like to develop a music visualizer app for tvOS which has the ability to listen to whatever background audio is playing (like Spotify, Pandora, etc.). Does anyone know if this is even possible on iOS/tvOS? In other words, there would have to be some functionality that allows the system audio output to be treated like an audio input.
I imagine that it would be the same functionality as doing a screen recording capture, at least the audio part.
My goal is to be able to do this programatically (Objective-C) so that the user doesn't have to do anything, it just "works" out of the box, so to speak.
Thanks

Related

Flutter - How to have audio play when phone screen is off

I am building an app where there is a person is speaking, kinda like a podcast, and I would like the listener to be able to listen when the screen is off.
I am using Flutter, and the media player is complete, but if i turn the phone screen off, the media stops.
I have no idea how to treat this so when you turn off the screen, the media will still play.
You need to use a background services plugin. I recommend the audio_services plugin available here: https://pub.dev/packages/audio_service#-installing-tab-

make my apps music/sfx stop if background audio is playing from a different app?

I'm looking to achieve the opposite effect of AVAudioSessionCategoryAmbientSolo.
Currently my options seem to be stick with solo(default) and have my app stop any pre playing music/sfx and play my apps music/sfx
or
I can use Ambient and have background audio mix with my apps music/sfx.
The effect I want is the opposite of solo. If the user is playing music or listening to a podcast from another app, then I dont want my app to play any sound. If the user isn't listening to anything else and starts my app, then my app can play it's music/sfx.
Seems ambient and solo are my only options unless I'm missing something.
If it has any bearing I'm using spritekit and swift.

Implement Audio Trimming in iOS

I want to implement audio trimming in iOS, I want something like a two way slider that the user can slide over a particular period of the recorded audio, and then I will save that audio.
Are there any libraries available for it?

AVAudioRecorder and AirPlay Mirrioring

When I have an AVAudioRecorder Session active - (when I'm recording audio) I can't activate AirPlay mirroring on the device. Airplay mirroring just deactivates while the app is running and switches it back on when the app exits. This post seems to suggest there is no way around this.
My thoughts are to try:
using a lower level recording framework
or outputting a separate window to external display, rather than mirroring (I've tried this, it doesn't work).
Is there another way around this, or do you know whether either of these methods are known to work?
Using AudioQueue to record (like Apple's Sample Code Speak Here) rather than the AVRecorder works. A bit more work to implement, but recording continues on or off Airplay mirroring.

Use iPhone's multitasking music controls in an app

I've searched the Internet for a while to try and find an answer to this. If you open up the multitasking bar and swipe to the left there are music controls that can be used by whatever app is playing music (ie Music, Pandora, etc.). I have not yet discovered a way to use these in my own music playing application. Does anyone know how to do that?
You should take a look at this example in the Apple API docs examples. It's basically what you want, a small audio player that interfaces with iTunes, lets you pick songs from the library and behaves much like the standard music player, including the music controls callbacks.

Resources