omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    question on undocumented sound.Player class

    Pythonista
    3
    3
    2755
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wradcliffe
      wradcliffe last edited by

      I just ran into the SoundDemo.py sample and believe I could use the looping feature. I am unpacking soundfonts into wav files and most of these require looping to be played correctly. The demo code at https://gist.github.com/omz/10023837 shows looping across the whole file, but sound font sounds mostly loop from an offset (some #frames) into the sound till the end. Have you considered having a loop start and end value in your new API? Also - the sample as written does not generate any sound under the current beta. Might be due to caf file location changes under IOS8 but no error is thrown.

      1 Reply Last reply Reply Quote 0
      • JadedTuna
        JadedTuna last edited by

        Just tried this script on iPad 3 with stable Pythonista build (1.5 I think?). Seems to work just fine.

        1 Reply Last reply Reply Quote 0
        • dgelessus
          dgelessus last edited by

          Yeah, the script depends on Pythonista.app being located in ~, which is no longer the case with iOS 8 and any version above 1.5. Here's a fixed version of the line with the sound.Player constructor:

          self.player = sound.Player(os.path.expanduser(os.path.join(os.path.dirname(os.__file__), "../Beep.caf")))
          

          (Owch, my ears. Running this script with headphones on is a bad idea.)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors