Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
195 chris 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
<!--NewPage-->
3
<HTML>
4
<HEAD>
5
<!-- Generated by javadoc (build 1.6.0_26) on Sun Sep 18 18:13:16 EDT 2011 -->
6
<TITLE>
7
Sound (libgdx API)
8
</TITLE>
9
 
10
<META NAME="date" CONTENT="2011-09-18">
11
 
12
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
13
 
14
<SCRIPT type="text/javascript">
15
function windowTitle()
16
{
17
    if (location.href.indexOf('is-external=true') == -1) {
18
        parent.document.title="Sound (libgdx API)";
19
    }
20
}
21
</SCRIPT>
22
<NOSCRIPT>
23
</NOSCRIPT>
24
 
25
</HEAD>
26
 
27
<BODY BGCOLOR="white" onload="windowTitle();">
28
<HR>
29
 
30
 
31
<!-- ========= START OF TOP NAVBAR ======= -->
32
<A NAME="navbar_top"><!-- --></A>
33
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35
<TR>
36
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37
<A NAME="navbar_top_firstrow"><!-- --></A>
38
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39
  <TR ALIGN="center" VALIGN="top">
40
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Sound.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48
  </TR>
49
</TABLE>
50
</TD>
51
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52
 
53
                                libgdx API
54
                                <style>
55
                                body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
56
                                pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
57
                                h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%;  font-weight:bold }
58
                                .TableHeadingColor { background:#EEEEFF; }
59
                                a { text-decoration:none }
60
                                a:hover { text-decoration:underline }
61
                                a:link, a:visited { color:blue }
62
                                table { border:0px }
63
                                .TableRowColor td:first-child { border-left:1px solid black }
64
                                .TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
65
                                hr { border:0px; border-bottom:1px solid #333366; }
66
                                </style>
67
                        </EM>
68
</TD>
69
</TR>
70
 
71
<TR>
72
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
73
&nbsp;<A HREF="../../../../com/badlogic/gdx/audio/Music.html" title="interface in com.badlogic.gdx.audio"><B>PREV CLASS</B></A>&nbsp;
74
&nbsp;NEXT CLASS</FONT></TD>
75
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
76
  <A HREF="../../../../index.html?com/badlogic/gdx/audio/Sound.html" target="_top"><B>FRAMES</B></A>  &nbsp;
77
&nbsp;<A HREF="Sound.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
78
&nbsp;<SCRIPT type="text/javascript">
79
  <!--
80
  if(window==top) {
81
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
82
  }
83
  //-->
84
</SCRIPT>
85
<NOSCRIPT>
86
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
87
</NOSCRIPT>
88
 
89
 
90
</FONT></TD>
91
</TR>
92
<TR>
93
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
94
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
95
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
96
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
97
</TR>
98
</TABLE>
99
<A NAME="skip-navbar_top"></A>
100
<!-- ========= END OF TOP NAVBAR ========= -->
101
 
102
<HR>
103
<!-- ======== START OF CLASS DATA ======== -->
104
<H2>
105
<FONT SIZE="-1">
106
com.badlogic.gdx.audio</FONT>
107
<BR>
108
Interface Sound</H2>
109
<DL>
110
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable</A></DD>
111
</DL>
112
<HR>
113
<DL>
114
<DT><PRE>public interface <B>Sound</B><DT>extends <A HREF="../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable</A></DL>
115
</PRE>
116
 
117
<P>
118
<p>
119
 A Sound is a short audio clip that can be played numerous times in parallel. It's completely loaded into memory so only load
120
 small audio files. Call the <A HREF="../../../../com/badlogic/gdx/audio/Sound.html#dispose()"><CODE>dispose()</CODE></A> method when you're done using the Sound.
121
 </p>
122
 
123
 <p>
124
 Sound instances are created via a call to <A HREF="../../../../com/badlogic/gdx/Audio.html#newSound(com.badlogic.gdx.files.FileHandle)"><CODE>Audio.newSound(FileHandle)</CODE></A>.
125
 </p>
126
<P>
127
 
128
<P>
129
<DL>
130
<DT><B>Author:</B></DT>
131
  <DD>badlogicgames@gmail.com</DD>
132
</DL>
133
<HR>
134
 
135
<P>
136
 
137
<!-- ========== METHOD SUMMARY =========== -->
138
 
139
<A NAME="method_summary"><!-- --></A>
140
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
141
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
142
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
143
<B>Method Summary</B></FONT></TH>
144
</TR>
145
<TR BGCOLOR="white" CLASS="TableRowColor">
146
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147
<CODE>&nbsp;void</CODE></FONT></TD>
148
<TD><CODE><B><A HREF="../../../../com/badlogic/gdx/audio/Sound.html#dispose()">dispose</A></B>()</CODE>
149
 
150
<BR>
151
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Releases all the resources.</TD>
152
</TR>
153
<TR BGCOLOR="white" CLASS="TableRowColor">
154
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
155
<CODE>&nbsp;void</CODE></FONT></TD>
156
<TD><CODE><B><A HREF="../../../../com/badlogic/gdx/audio/Sound.html#play()">play</A></B>()</CODE>
157
 
158
<BR>
159
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays the sound.</TD>
160
</TR>
161
<TR BGCOLOR="white" CLASS="TableRowColor">
162
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
163
<CODE>&nbsp;void</CODE></FONT></TD>
164
<TD><CODE><B><A HREF="../../../../com/badlogic/gdx/audio/Sound.html#play(float)">play</A></B>(float&nbsp;volume)</CODE>
165
 
166
<BR>
167
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays the sound.</TD>
168
</TR>
169
<TR BGCOLOR="white" CLASS="TableRowColor">
170
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
171
<CODE>&nbsp;void</CODE></FONT></TD>
172
<TD><CODE><B><A HREF="../../../../com/badlogic/gdx/audio/Sound.html#stop()">stop</A></B>()</CODE>
173
 
174
<BR>
175
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stops playing all instances of this sound.</TD>
176
</TR>
177
</TABLE>
178
&nbsp;
179
<P>
180
 
181
<!-- ============ METHOD DETAIL ========== -->
182
 
183
<A NAME="method_detail"><!-- --></A>
184
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
185
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
186
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
187
<B>Method Detail</B></FONT></TH>
188
</TR>
189
</TABLE>
190
 
191
<A NAME="play()"><!-- --></A><H3>
192
play</H3>
193
<PRE>
194
void <B>play</B>()</PRE>
195
<DL>
196
<DD>Plays the sound. If the sound is already playing, it will be played again, concurrently.
197
<P>
198
<DD><DL>
199
</DL>
200
</DD>
201
<DD><DL>
202
</DL>
203
</DD>
204
</DL>
205
<HR>
206
 
207
<A NAME="play(float)"><!-- --></A><H3>
208
play</H3>
209
<PRE>
210
void <B>play</B>(float&nbsp;volume)</PRE>
211
<DL>
212
<DD>Plays the sound. If the sound is already playing, it will be played again, concurrently.
213
<P>
214
<DD><DL>
215
</DL>
216
</DD>
217
<DD><DL>
218
<DT><B>Parameters:</B><DD><CODE>volume</CODE> - the volume in the range [0,1]</DL>
219
</DD>
220
</DL>
221
<HR>
222
 
223
<A NAME="stop()"><!-- --></A><H3>
224
stop</H3>
225
<PRE>
226
void <B>stop</B>()</PRE>
227
<DL>
228
<DD>Stops playing all instances of this sound.
229
<P>
230
<DD><DL>
231
</DL>
232
</DD>
233
<DD><DL>
234
</DL>
235
</DD>
236
</DL>
237
<HR>
238
 
239
<A NAME="dispose()"><!-- --></A><H3>
240
dispose</H3>
241
<PRE>
242
void <B>dispose</B>()</PRE>
243
<DL>
244
<DD>Releases all the resources.
245
<P>
246
<DD><DL>
247
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../com/badlogic/gdx/utils/Disposable.html#dispose()">dispose</A></CODE> in interface <CODE><A HREF="../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable</A></CODE></DL>
248
</DD>
249
<DD><DL>
250
</DL>
251
</DD>
252
</DL>
253
<!-- ========= END OF CLASS DATA ========= -->
254
<HR>
255
 
256
 
257
<!-- ======= START OF BOTTOM NAVBAR ====== -->
258
<A NAME="navbar_bottom"><!-- --></A>
259
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
260
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
261
<TR>
262
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
263
<A NAME="navbar_bottom_firstrow"><!-- --></A>
264
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
265
  <TR ALIGN="center" VALIGN="top">
266
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
267
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
268
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
269
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Sound.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
270
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
271
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
272
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
273
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
274
  </TR>
275
</TABLE>
276
</TD>
277
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
278
libgdx API</EM>
279
</TD>
280
</TR>
281
 
282
<TR>
283
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
284
&nbsp;<A HREF="../../../../com/badlogic/gdx/audio/Music.html" title="interface in com.badlogic.gdx.audio"><B>PREV CLASS</B></A>&nbsp;
285
&nbsp;NEXT CLASS</FONT></TD>
286
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
287
  <A HREF="../../../../index.html?com/badlogic/gdx/audio/Sound.html" target="_top"><B>FRAMES</B></A>  &nbsp;
288
&nbsp;<A HREF="Sound.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
289
&nbsp;<SCRIPT type="text/javascript">
290
  <!--
291
  if(window==top) {
292
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
293
  }
294
  //-->
295
</SCRIPT>
296
<NOSCRIPT>
297
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
298
</NOSCRIPT>
299
 
300
 
301
</FONT></TD>
302
</TR>
303
<TR>
304
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
305
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
306
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
307
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
308
</TR>
309
</TABLE>
310
<A NAME="skip-navbar_bottom"></A>
311
<!-- ======== END OF BOTTOM NAVBAR ======= -->
312
 
313
<HR>
314
 
315
                                <div style="font-size:9pt"><i>
316
                                Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
317
                                </i></div>
318
 
319
</BODY>
320
</HTML>