Set a maximum frequency for playing sounds #355
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This avoids a lot of repeated "you've got mail" if you have multiple messages arrive on startup.
self.lastSoundTime = datetime.datetime.now()
should be called when the sound is actually played, not when it might be played. Otherwise, a message every 30 seconds will keep sounds from ever being played, rather than the intended result of having a sound played at maximum every 60 seconds.I think.
I wrote it deliberately that way so that the time is reset whenever a message is received. That way if you have a lot of messages being received a sound will only be played if a new message comes in 60 seconds after the last message was received. I can alter that though and make the time shorter or longer.