Swift - play sounds parallel with spotify - ios

Is it possible to play a sound in swift when another one is being played, my client wants to make an app that emit sounds while spotify is playing songs too, is that possible ?

No you cant have multiple apps playing sounds at the same time.

Related

How to record in real time the audio sounds and then play them with the in-built speakers or headphones in iOS Swift?

I want to build an iOS app using AVAudioRecorder and AVAudioPlayer simoultaneously. Something like a megaphone that records in real time voices and sounds in the ambient and play them all in real time, without any type of sound processing. I want to create a temporary file with a single button start/stop. Suggestions? How can I do?
For recording purpose, you can follow this tutorial :
Speech-to-text
For Playing your recorded file, follow this : text-to-speech

Control Spotify background music in iOS app

I'm making an app that uses gestures to change the current background music e.g Pause, Skip, etc. Currently I can do this fine for music that is playing through the native MPMusicPlayerController class.
However I am unable to control the music when it is coming from Spotify (or other music playing apps for that matter). I believe this is to do with Apple's sandboxing policy between apps.
I'm not too hopeful, but does anyone know a way to trigger a universal music control notification? Something similar to what must happen on the iOS lockscreen when background music is playing? All my research tells me this almost definitely done through a private API, but am unable to get confirmation.
Alternatively, is there any Spotify specific way to achieve this?
Unfortunately the answer is No.
You can't get any information/Notifications about other apps, even regarding what's now playing.
As you wondered, it's all regarding the Sandboxing policy of Apple.

Play Music Behind App?

I recently released my app on the app store and one of my friends noticed that he couldnt listen to his music and play the game at the same time because each time the scene switched the music was cut out. What kind of code would I use to fix this so people can play their own music in the background?
If you want to use ObjectAL this functionality is as simple as:
[OALSimpleAudio sharedInstance].allowIpod = YES;
You need to look into AVAudioSession. It provides the audio sessions categories which you can use to specify what should happen in the relationship between your sounds and other sounds.

iOS: developing audio (music) streaming from server

I'm researching to start developing an audio streaming apps. First thing I'd like to ask is the framework to use for it. I've tested DOUAudioStreamer , tumtumtum/StreamingKit , RadioKit and etc.
The framework needs to be able to seek a song from certain seconds with low latency. Spotify has that amazing seek feature i.e. find a song you've never listened before and play it, then slide the time slider to the middle, the song continues to play with low latency as if it has downloaded the whole song before.
I guess you could do some predictive analysis as to what songs the user will listen to next, i.e. start caching songs before they actually start to play. That will at least improve the experience somewhat.

iOS - Streaming Multitrack Audio

I'm building an app in which I need to steam multiple tracks of audio that make up a song. They all need to be synchronized so the song plays back naturally.
I've been able to play back local multitrack audio very well with the solution on this thread: multi track mp3 playback for iOS application, but it looks like AVAudioPlayer isn't able to stream.
I've been looking into working with DOUAudioStreamer because I've read that it's the best solution for streaming audio on iOS without going pretty low-level, but it seems to lack the equivalent of a -playAtTime: method, which is how the tracks were synced up using `AVAudioPlayer.
Does anyone know a workaround for this using DOUAudioStreamer, or have any advice on another way I should approach this? Thanks.

Resources