Apologies for spam; we've changed our policy by requiring approval for accounts, and deleted all existing spam and user - thanks for your help flagging content. We continue to test our forums and Vanilla software, aiming for release early in 2013. If you need to give us feedback outside the forum, contact us via http://createdigitalmusic.com/contact/ or on Facebook
Sound when phone screen is off, and zipped resources question
  • Hi,

    First of all, thanks Peter for this awesome library. After the initial setup it has proven to be quite easy to work with and I am super grateful for it as it allows more artists to create mobile musical apps easier than before.

    I have two questions:

    1) Is there a way to keep the PdAudio running when the screen time's out? I am working on an app that is more of a piece than an instrument and requires no direct GUI interaction and I'm finding that I am just killing the battery life with the screen on.

    2) I am using samples, for the moment, and it seems that everytime I open the app it is unzipping my resources again and again, so the App Data doubles and triples. Is there a better way to do this? And is there a way to have them unzipped and then inform the app that it doesn't need to unzip it again and again?

    Thanks again,

    Colin

  • This is for Android by the way.

  • pbrinkmannpbrinkmann
    Accepted Answer

    Hi Colin, Glad to hear that libpd is working well for you.

    About keeping Pd running when the screen goes to sleep, this came up in another thread: http://createdigitalnoise.com/discussion/622/self-remixing-album-made-with-pddroidparty/p1

    The upshot is that you either need a wake lock or you can set the FLAG_SHOW_WHEN_LOCKED flag; make sure to use PdService if you want to choose the latter. ScenePlayer uses FLAG_SHOW_WHEN_LOCKED: https://github.com/libpd/pd-for-android/blob/master/ScenePlayer/src/org/puredata/android/scenes/ScenePlayer.java#L297

    About zipped resources, I'm not entirely sure why your app data double and triples (why doesn't it just overwrite the old version when unzipping resources?), but you can use the IoUtils class of libpd if you want to make sure to unpack a resource only once: https://github.com/libpd/libpd/blob/master/java/org/puredata/core/utils/IoUtils.java

  • Awesome, I will totally try this out and let you know how it goes.

    thanks!