source: release-kits/lirk3/resources/gs3-release-maker/ant/docs/manual/OptionalTasks/sound.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 3.3 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>Sound Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="sound">Sound</a></h2>
12<h3>Description</h3>
13<p>Plays a sound-file at the end of the build, according to whether
14the build failed or succeeded. You can specify either a specific
15sound-file to play, or, if a directory is specified, the
16<code>&lt;sound&gt;</code> task will randomly select a file to play.
17Note: At this point, the random selection is based on all the files
18in the directory, not just those ending in appropriate suffixes
19for sound-files, so be sure you only have sound-files in the
20directory you specify.</p>
21<p>
22Unless you are running on Java 1.3 or later, you need the Java Media Framework
23on the classpath (javax.sound).
24</p>
25
26
27<h3>Nested Elements</h3>
28<h4>success</h4>
29<p>Specifies the sound to be played if the build succeeded.</p>
30<h4>fail</h4>
31<p>Specifies the sound to be played if the build failed.</p>
32
33<h3>Nested Element Parameters</h3>
34<p>
35The following attributes may be used on the <code>&lt;success&gt;</code>
36and <code>&lt;fail&gt;</code> elements:</p>
37<table border="1" cellpadding="2" cellspacing="0">
38 <tr>
39 <td valign="top"><b>Attribute</b></td>
40 <td valign="top"><b>Description</b></td>
41 <td align="center" valign="top"><b>Required</b></td>
42 </tr>
43 <tr>
44 <td valign="top">source</td>
45 <td valign="top">the path to a sound-file directory, or the name of a
46specific sound-file, to be played.
47 </td>
48 <td valign="top" align="center">Yes</td>
49 </tr>
50 <tr>
51 <td valign="top">loops</td>
52 <td valign="top">the number of extra times to play the sound-file;
53 default is <code>0</code>.
54 </td>
55 <td valign="top" align="center">No</td>
56 </tr>
57 <tr>
58 <td valign="top">duration</td>
59 <td valign="top">the amount of time (in milliseconds) to play
60 the sound-file.
61 </td>
62 <td valign="top" align="center">No</td>
63 </tr>
64</table>
65
66<h3>Examples</h3>
67<blockquote>
68<pre>
69&lt;target name=&quot;fun&quot; if=&quot;fun&quot; unless=&quot;fun.done&quot;&gt;
70 &lt;sound&gt;
71 &lt;success source=&quot;${user.home}/sounds/bell.wav&quot;/&gt;
72 &lt;fail source=&quot;${user.home}/sounds/ohno.wav&quot; loops=&quot;2&quot;/&gt;
73 &lt;/sound&gt;
74 &lt;property name=&quot;fun.done&quot; value=&quot;true&quot;/&gt;
75&lt;/target&gt;
76</pre>
77</blockquote>
78plays the <code>bell.wav</code> sound-file if the build succeeded, or
79the <code>ohno.wav</code> sound-file if the build failed, three times,
80if the <code>fun</code> property is set to <code>true</code>.
81If the target
82is a dependency of an &quot;initialization&quot; target that other
83targets depend on, the
84<code>fun.done</code> property prevents the target from being executed
85more than once.
86<blockquote>
87<pre>
88&lt;target name=&quot;fun&quot; if=&quot;fun&quot; unless=&quot;fun.done&quot;&gt;
89 &lt;sound&gt;
90 &lt;success source=&quot;//intranet/sounds/success&quot;/&gt;
91 &lt;fail source=&quot;//intranet/sounds/failure&quot;/&gt;
92 &lt;/sound&gt;
93 &lt;property name=&quot;fun.done&quot; value=&quot;true&quot;/&gt;
94&lt;/target&gt;
95</pre>
96</blockquote>
97randomly selects a sound-file to play when the build succeeds or fails.
98
99<hr>
100<p align="center">Copyright &copy; 2001-2002,2004 The Apache Software Foundation. All rights
101Reserved.</p>
102
103</body>
104</html>
105
Note: See TracBrowser for help on using the repository browser.