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.


    No sound when I run a script at all

    Pythonista
    6
    14
    10834
    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.
    • Sebastian
      Sebastian last edited by

      Does this work?

      import sound
      
      sound.set_honors_silent_switch(False)
      sound.set_volume(1)
      sound.play_effect('piano:D3')
      
      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        Is your device muted? Try moving the (physical) switch next to the volume buttons. If that controls the screen rotation lock, open the Control Center (swipe up from the bottom of the screen) and disable the mute switch there.

        1 Reply Last reply Reply Quote 1
        • upwart
          upwart last edited by

          I tried the script. The set_honors_silent_switch gives an error message. If I outcomment it, I still can't here a thing.
          Also, the iPad is not muted! If I go to a .caf file, I can just play it. But not from a script.

          It drives me crazy ...

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

            Pythonista 1.5, I guess?

            import sound
            
            player = sound.Player('Beep-beep-beep.mp3')
            
            def playmp3():    
                player.play()
                
            playmp3()
            

            I download the file here.

            Original post

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

              Brumm,

              Also running this code results in silence.
              I run the latest production release, so I suppose it's 1.5 .

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

                Hi,
                sorry for asking, but did you put the file in the same directory?
                Where can I find a caf file for testing?

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

                  I have solved it, with help of an old forum topic. The iPad was muted, which is not obvious on an Air 2.
                  Competely mystery why Pythonista uses this switch, as no else seems to do that!

                  Thanks everyone.

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

                    By accident I found also this link...

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

                      If your are enrolled in the Pythonista beta program then you are running v1.6 and if you are not enrolled then you are probably running Pythonista v1.5. You can determine for yourself by running https://github.com/cclauss/Ten-lines-or-less/blob/master/pythonista_version.py

                      There are builtin CAF files in both versions that you can access by clicking in the editor so that you are in edit mode and then click on the + icon at the top of the screen then click on Sounds and selecting a sound.

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

                        Thank you, it's a while since I used Pythonista :(. I'm still waiting for 1.6...

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

                          Competely mystery why Pythonista uses this switch, as no else seems to do that!

                          Pretty much all apps that use sound effects should respect the mute switch, i.e. most games.

                          For music playback apps, movies and the like, where you initiate the audio playback explicitly (e.g. by hitting a play button), it's usually ignored.

                          Sound playback in Pythonista typically falls into the first category, so it seemed appropriate to use the switch (and I really hate it to accidentally make sounds with my device while in public).

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

                            @omz

                            Ok. That's clear.
                            Is Sebastian's sound.set_honors_silent_switch(False) statement something to circumvent this behaviour. It didn't seem to work in Pythonista 1.5, but may be in 1.6 ?

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

                              @upwart I've added that function in the beta, it's not available in 1.5.

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