You're not executing play; you're executing a shell that forks and executes play and immediately exits. You are sending the signal to the zombie shell instead of play.
Replace
exec 'play "/home/myname/soundfile.wav" &';
with
exec 'play', '/home/myname/soundfile.wav';
In reply to Re: Killing a child process
by ikegami
in thread Killing a child process
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |