Community Discussions and Support
Observation/Query Concerning PlaySound in POP3 Rule Set

Thank you both for your replies.

I think it is as you suggest. The sound is longer than the usual ping, as I wanted it to be distinguishable. The Windows PlaySound function can operate synchronously or asynchronously. The default is synchronously. Presumably PMail needs to minimise any delays during the checking function.

 TFC 

<p>Thank you both for your replies.</p><p>I think it is as you suggest. The sound is longer than the usual ping, as I wanted it to be distinguishable. The Windows PlaySound function can operate synchronously or asynchronously. The default is synchronously. Presumably PMail needs to minimise any delays during the checking function.</p><p> TFC </p>

I want to set up a rule which will notify me if there are messages in a mailbox without downloading those messages. I have set up a ruleset like this :-

Yahoo (Mail Check)
Always Call "SOUND:"
Always Exit ""
Label "SOUND:"
Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav"
Always Return ""

I notice that when the rule is triggered, the sound is only played once, irrespective of how many messages are present, unless there are none in which case the rule is not triggered. This is fine for me, but I was interested in what PlaySound was doing e.g. just not returning, or what? So I modified the rule to :-

Yahoo (Mail Check)
Always Call "SOUND:"
Always Dialog "OOO"
Always Exit ""
Label "SOUND:"
Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav"
Always Return "" 

 Now, when the rule is triggered and there is more than 1 email, the dialog box appears, followed by the sound, and if you wait until the sound is complete, and then click the OK button, the process is repeated, another dialog box appears followed by the sound. If, on the other hand, you click on the OK button as soon as the dialog box appears, you still see two occurrences of the dialog box, but only the sound is played only ONCE.

It seems that the playing of the sound is triggered asynchronously, and the rule carries on regardless of whether the sound is finished or not. Also, once the playing of the sound is triggered a further attempt to play sound will not be successful and ignored.

I did also try removing the Call/Return to see if the problem was caused by the Call process, so the rule became :-

Yahoo (Mail Check)
Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav"
Always Return ""

OR

Yahoo (Mail Check)
Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav"
Always Dialog "OOO"
Always Return ""

The results were the same as when using the Call process. 

Is this how the PlaySound action works or is intended to work? It is perhaps confusing when debugging a rule and Playsound is involved. You probably need to replace the Playsound action with a diagnostic Dialog box action to confirm what is happening.

<p>I want to set up a rule which will notify me if there are messages in a mailbox without downloading those messages. I have set up a ruleset like this :-</p><p>Yahoo (Mail Check) Always Call "SOUND:" Always Exit "" Label "SOUND:" Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav" Always Return ""</p><p>I notice that when the rule is triggered, the sound is only played once, irrespective of how many messages are present, unless there are none in which case the rule is not triggered. This is fine for me, but I was interested in what PlaySound was doing e.g. just not returning, or what? So I modified the rule to :-</p><p>Yahoo (Mail Check) Always Call "SOUND:" Always Dialog "OOO" Always Exit "" Label "SOUND:" Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav" Always Return "" </p><p> Now, when the rule is triggered and there is more than 1 email, the dialog box appears, followed by the sound, and if you wait until the sound is complete, and then click the OK button, the process is repeated, another dialog box appears followed by the sound. If, on the other hand, you click on the OK button as soon as the dialog box appears, you still see two occurrences of the dialog box, but only the sound is played only ONCE.</p><p>It seems that the playing of the sound is triggered asynchronously, and the rule carries on regardless of whether the sound is finished or not. Also, once the playing of the sound is triggered a further attempt to play sound will not be successful and ignored.</p><p>I did also try removing the Call/Return to see if the problem was caused by the Call process, so the rule became :-</p><p>Yahoo (Mail Check) Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav" Always Return "" </p><p>OR</p><p>Yahoo (Mail Check) Always PlaySound "C:\\PMAIL\\Programs\\RESOURCE\\Yahoo! email Alert.wav" Always Dialog "OOO" Always Return ""</p><p>The results were the same as when using the Call process. </p><p>Is this how the PlaySound action works or is intended to work? It is perhaps confusing when debugging a rule and Playsound is involved. You probably need to replace the Playsound action with a diagnostic Dialog box action to confirm what is happening.</p>

Interesting question.  It makes sense that for new mail notification (via Reporting/logging configuration) a sound should only play upon arrival of the first message of any POP3 cycle.  However, one would expect a sound invoked by a rule should play on every trigger.  It's possible that the sound file is being invoked multiple times but you just can't here it.  Consider that when you repeatedly double click on a .wav file the play restarts after every double click.  Rules process so quickly that it's possible that the only sound file plays that you hear are the ones that have time to play through.  Obviously the length of the sound file would impact this.  Perhaps a test with a short sound like the Windows Ding.wav file is in order although I suspect rule processing is too quick for even a single ding to have time to execute and finish playing on sequential rule triggers.

 

<p>Interesting question.  It makes sense that for new mail notification (via Reporting/logging configuration) a sound should only play upon arrival of the first message of any POP3 cycle.  However, one would expect a sound invoked by a rule should play on every trigger.  It's possible that the sound file is being invoked multiple times but you just can't here it.  Consider that when you repeatedly double click on a .wav file the play restarts after every double click.  Rules process so quickly that it's possible that the only sound file plays that you hear are the ones that have time to play through.  Obviously the length of the sound file would impact this.  Perhaps a test with a short sound like the Windows Ding.wav file is in order although I suspect rule processing is too quick for even a single ding to have time to execute and finish playing on sequential rule triggers.</p><p> </p>

[quote user="bfluet"]

IRules process so quickly that it's possible that the only sound file plays that you hear are the ones that have time to play through.  Obviously the length of the sound file would impact this.  Perhaps a test with a short sound like the Windows Ding.wav file is in order although I suspect rule processing is too quick for even a single ding to have time to execute and finish playing on sequential rule triggers.

 [/quote]On my setup I have SpamHalter activated and also have a rule to move messages identified by SpamAssassin (SA) as likely spam to a folder for inspection.  This rule includes playing a short sound. Most times, but not always, I hear the sound for every such SA identified message.

KSQR

[quote user="bfluet"]<p>IRules process so quickly that it's possible that the only sound file plays that you hear are the ones that have time to play through.  Obviously the length of the sound file would impact this.  Perhaps a test with a short sound like the Windows Ding.wav file is in order although I suspect rule processing is too quick for even a single ding to have time to execute and finish playing on sequential rule triggers.</p><p> [/quote]On my setup I have SpamHalter activated and also have a rule to move messages identified by SpamAssassin (SA) as likely spam to a folder for inspection.  This rule includes playing a short sound. Most times, but not always, I hear the sound for every such SA identified message.</p><p>KSQR </p>
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft