Forum Archive

No sound on Notification

ihf

notification.schedule("hello world",5,"circles")

Notification fires but no sound. Volume is up. What am I missing?

techteej

Are you sure "circles" is the name of a sound file Built-In To Pythonista?

ihf

I thought it was the name of notification sound (not like sound.play_effect). In any case, the docs say that if the sound doesn't exist, it will play the default notification.

techteej

@ihf It has to be named exactly like in sound.play_effect();

# coding: utf-8
import notification
notification.schedule("hello world", 5, "Coin_5")

Works for me perfectly.

ihf

Yes, that works. Thanks. The notification. schedule function has the delay (sec) parm but it also returns a fire_date. Isit possible to set a notification for a future date other than putting it in as a delay?

JonB

try

import datetime
dt_sec=(datetime.datetime(2015,9,5,0,0,0,0)-datetime.datetime.now()).seconds