To register and login, use your Google, Twitter, Facebook, LinkedIn, or OpenID credentials.

This is allowing us to stop most spam registrations. We've deleted most of the spam accounts that got through, and we're closely watching for more.

Background Audio?

dreamlessdreamless Posts: 63
edited 12:15AM in Pd Everywhere
Hello,
I'm currently trying to get my app to play audio while in the background or when the screen is locked on my iOS devices. I tried following the instructions in another thread and changed the audio session category but it doesn't seem to be working. Is there something else that I need to do to get this working? Thank you. 

Comments

  • chr1srchr1sr Posts: 14

    I hope this helps, I'm still new to all this but I managed to get it working from the instructions I found here.
    https://github.com/libpd/pd-for-ios/tree/master/PdSettings

    Here's the steps that worked for me.

    *I'm currently running Xcode 4.4

    1.) In your app's info.plist, add an array entry called "UIBackgroundModes".
    Once I added it, Xcode automatically renamed the key to "Required Background Modes".

    2.) In "Required Background Modes" add "audio" for the value.
    Again, Xcode automatically renamed this to "App plays audio".

    3.) *I'm using PDAudioController for audio settings.
    In your apps delegate.m file, make sure self.audiocontroller.active = YES is set for applicationWillResignActive, applicationDidEnterBackground, applicationWillEnterForeground, applicationDidBecomeActive.

    I was a bit stressed about background audio as I thought it would be harder to get working as there hadn't been much information I could find on it for libpd.
    This worked so easily for me it brought a big beaming, shitty grin to my face.

  • dreamlessdreamless Posts: 63

    Thanks. I figured it out also but felt dumb since the instructions are right on the front page of the github repo.

  • alxkntalxknt Posts: 1

    re: chr1sr's steps.
    ignore step 3.
    i have background audio in iOS6.1 with nothing related to pd being set in applicationWillResignAcitve, applicationDidEnterBackground, applicationWillEnterForeground, applicationDidBecomeActive.

    one other thing, when configuring your PdAudioController, don't use the configureAmbientWithSampleRate: method. use configurePlaybackWithSampleRate:

  • sinewavesinewave Posts: 19
    Hi,
    I know this is old, but it's one of two threads users will currently end up when having background audio hassles.

    Setting the above settings (any combination) for background audio does not seem to be working in iOS 7. Anyone have a fix for this?

    Cheers /A
  • sinewavesinewave Posts: 19
    edited May 2014
    Ok, PdSettings does work in the background on my device, but not in the simulator. Good to know... Comparing now to find the issue...
  • sinewavesinewave Posts: 19
    Ok, so I'm using spritekit in my app, and it was that that was causing the crash. So, to attempt to offer some useful info and not just noise, I can confirm that the only steps needed to get bkgd audio working in iOS7 are as above - specifically set the background mode in info.plist and make sure you call configurePlayback.... rather than configureAmbient...
Sign In or Register to comment.