Execute the task.
AntSoundPlayer soundPlayer = new AntSoundPlayer();
if (success == null) {
log("No nested success element found.", Project.MSG_WARN);
} else {
soundPlayer.addBuildSuccessfulSound(success.getSource(),
success.getLoops(), success.getDuration());
}
if (fail == null) {
log("No nested failure element found.", Project.MSG_WARN);
} else {
soundPlayer.addBuildFailedSound(fail.getSource(),
fail.getLoops(), fail.getDuration());
}
getProject().addBuildListener(soundPlayer);