org.apache.tools.ant.taskdefs.optional.sound
Class AntSoundPlayer
java.lang.Object
org.apache.tools.ant.taskdefs.optional.sound.AntSoundPlayer
- EventListener, LineListener, BuildListener
public class AntSoundPlayer
extends java.lang.Object
This class is designed to be used by any AntTask that requires audio output.
It implements the BuildListener interface to listen for BuildEvents and could
be easily extended to provide audio output upon any specific build events occuring.
I have only tested this with .WAV and .AIFF sound file formats. Both seem to work fine.
Version:
AntSoundPlayer
public AntSoundPlayer()
addBuildFailedSound
public void addBuildFailedSound(File fileFail,
int loopsFail,
Long durationFail)
fileFail
- the location of the audio file to be played
when the build failsloopsFail
- the number of times the file should be played
when the build is failsdurationFail
- the number of milliseconds the file should be
played when the build fails
addBuildSuccessfulSound
public void addBuildSuccessfulSound(File file,
int loops,
Long duration)
file
- the location of the audio file to be played when the
build is successfulloops
- the number of times the file should be played when
the build is successfulduration
- the number of milliseconds the file should be
played when the build is successful
update
public void update(LineEvent event)
This is implemented to listen for any line events and closes the
clip if required.
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.