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
-
I haven't used Pythonista for a while, but now I'm picking it up again. When I run any script with sound (via The Player claas), I can't hear a thing. From the folder, I can just play the .caf file properly.
Even the standard piano sample script doesn't work anymore!
I am running on an iPad Air 2 under iOS 9.2.Please advise.
-
Does this work?
import sound sound.set_honors_silent_switch(False) sound.set_volume(1) sound.play_effect('piano:D3')
-
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.
-
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 ...
-
Pythonista 1.5, I guess?
import sound player = sound.Player('Beep-beep-beep.mp3') def playmp3(): player.play() playmp3()
I download the file here.
-
Brumm,
Also running this code results in silence.
I run the latest production release, so I suppose it's 1.5 . -
Hi,
sorry for asking, but did you put the file in the same directory?
Where can I find a caf file for testing? -
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.
-
By accident I found also this link...
-
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.
-
Thank you, it's a while since I used Pythonista :(. I'm still waiting for 1.6...
-
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).
-
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 ? -
@upwart I've added that function in the beta, it's not available in 1.5.