823 lines
32 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_24) on Sun Apr 15 20:18:19 CEST 2012 -->
<TITLE>
SoundEffect
</TITLE>
<META NAME="date" CONTENT="2012-04-15">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SoundEffect";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SoundEffect.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/NoAudioHardwareException.html" title="class in Microsoft.Xna.Framework.Audio"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html" title="class in Microsoft.Xna.Framework.Audio"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?Microsoft/Xna/Framework/Audio/SoundEffect.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SoundEffect.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
Microsoft.Xna.Framework.Audio</FONT>
<BR>
Class SoundEffect</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>Microsoft.Xna.Framework.Audio.SoundEffect</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../System/IDisposable.html" title="interface in System">IDisposable</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public final class <B>SoundEffect</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../System/IDisposable.html" title="interface in System">IDisposable</A></DL>
</PRE>
<P>
Reference page contains links to related code samples.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Halofreak1990</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#SoundEffect(byte[], int, Microsoft.Xna.Framework.Audio.AudioChannels)">SoundEffect</A></B>(byte[]&nbsp;buffer,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes a new instance of SoundEffect based on an audio buffer, sample rate, and number of audio channels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#SoundEffect(byte[], int, int, int, Microsoft.Xna.Framework.Audio.AudioChannels, int, int)">SoundEffect</A></B>(byte[]&nbsp;buffer,
int&nbsp;offset,
int&nbsp;count,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels,
int&nbsp;loopStart,
int&nbsp;loopLength)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes a new instance of SoundEffect with specified parameters such as audio sample rate, channels, looping criteria, and a buffer to hold the audio.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html" title="class in Microsoft.Xna.Framework.Audio">SoundEffectInstance</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#CreateInstance()">CreateInstance</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new SoundEffectInstance for this SoundEffect.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#Dispose()">Dispose</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Releases the resources used by the SoundEffect.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#Dispose(boolean)">Dispose</A></B>(boolean&nbsp;disposing)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#finalize()">finalize</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html" title="class in Microsoft.Xna.Framework.Audio">SoundEffect</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#FromStream(java.io.InputStream)">FromStream</A></B>(java.io.InputStream&nbsp;stream)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a SoundEffect object based on the specified data stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html" title="class in Microsoft.Xna.Framework.Audio">SoundEffect</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#FromStream(System.IO.Stream)">FromStream</A></B>(<A HREF="../../../../System/IO/Stream.html" title="class in System.IO">Stream</A>&nbsp;stream)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a SoundEffect object based on the specified data stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#getDistanceScale()">getDistanceScale</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a value that adjusts the effect of distance calculations on the sound (emitter).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#getDopplerScale()">getDopplerScale</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a value that adjusts the effect of doppler calculations on the sound (emitter).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../System/TimeSpan.html" title="class in System">TimeSpan</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#getDuration()">getDuration</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the duration of the SoundEffect.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#getMasterVolume()">getMasterVolume</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the master volume that affects all SoundEffectInstance sounds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#getName()">getName</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the asset name of the SoundEffect.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../System/TimeSpan.html" title="class in System">TimeSpan</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#GetSampleDuration(int, int, Microsoft.Xna.Framework.Audio.AudioChannels)">GetSampleDuration</A></B>(int&nbsp;sizeInBytes,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the sample duration based on the specified sample size and sample rate.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#GetSampleSizeInBytes(System.TimeSpan, int, Microsoft.Xna.Framework.Audio.AudioChannels)">GetSampleSizeInBytes</A></B>(<A HREF="../../../../System/TimeSpan.html" title="class in System">TimeSpan</A>&nbsp;duration,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the size of the audio sample based on duration, sample rate, and audio channels.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;float</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#getSpeedOfSound()">getSpeedOfSound</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the speed of sound. 343.5 meters per second.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#IsDisposed()">IsDisposed</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets a value that indicates whether the object is disposed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#Play()">Play</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays a sound.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#Play(float, float, float)">Play</A></B>(float&nbsp;volume,
float&nbsp;pitch,
float&nbsp;pan)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays a sound based on specified volume, pitch, and panning.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#setDistanceScale(float)">setDistanceScale</A></B>(float&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a value that adjusts the effect of distance calculations on the sound (emitter).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#setDopplerScale(float)">setDopplerScale</A></B>(float&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets a value that adjusts the effect of doppler calculations on the sound (emitter).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#setMasterVolume(float)">setMasterVolume</A></B>(float&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the master volume that affects all SoundEffectInstance sounds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#setName(java.lang.String)">setName</A></B>(java.lang.String&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the asset name of the SoundEffect to the specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#setSpeedOfSound(float)">setSpeedOfSound</A></B>(float&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the speed of sound.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SoundEffect(byte[], int, Microsoft.Xna.Framework.Audio.AudioChannels)"><!-- --></A><H3>
SoundEffect</H3>
<PRE>
public <B>SoundEffect</B>(byte[]&nbsp;buffer,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels)</PRE>
<DL>
<DD>Initializes a new instance of SoundEffect based on an audio buffer, sample rate, and number of audio channels. Reference page contains links to related conceptual articles.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - Buffer that contains the audio data. The audio format must be PCM wave data.<DD><CODE>sampleRate</CODE> - Sample rate, in Hertz (Hz), of audio data.<DD><CODE>channels</CODE> - Number of channels (mono or stereo) of audio data.</DL>
</DL>
<HR>
<A NAME="SoundEffect(byte[], int, int, int, Microsoft.Xna.Framework.Audio.AudioChannels, int, int)"><!-- --></A><H3>
SoundEffect</H3>
<PRE>
public <B>SoundEffect</B>(byte[]&nbsp;buffer,
int&nbsp;offset,
int&nbsp;count,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels,
int&nbsp;loopStart,
int&nbsp;loopLength)</PRE>
<DL>
<DD>Initializes a new instance of SoundEffect with specified parameters such as audio sample rate, channels, looping criteria, and a buffer to hold the audio. Reference page contains links to related conceptual articles.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - Buffer that contains the audio data. The audio format must be PCM wave data.<DD><CODE>offset</CODE> - Offset, in bytes, to the starting position of the audio data.<DD><CODE>count</CODE> - Amount, in bytes, of audio data.<DD><CODE>sampleRate</CODE> - Sample rate, in Hertz (Hz), of audio data.<DD><CODE>channels</CODE> - Number of channels (mono or stereo) of audio data.<DD><CODE>loopStart</CODE> - Loop start in samples.<DD><CODE>loopLength</CODE> - Loop length in samples.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getDistanceScale()"><!-- --></A><H3>
getDistanceScale</H3>
<PRE>
public static float <B>getDistanceScale</B>()</PRE>
<DL>
<DD>Gets a value that adjusts the effect of distance calculations on the sound (emitter).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setDistanceScale(float)"><!-- --></A><H3>
setDistanceScale</H3>
<PRE>
public static void <B>setDistanceScale</B>(float&nbsp;value)</PRE>
<DL>
<DD>Sets a value that adjusts the effect of distance calculations on the sound (emitter).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDopplerScale()"><!-- --></A><H3>
getDopplerScale</H3>
<PRE>
public static float <B>getDopplerScale</B>()</PRE>
<DL>
<DD>Gets a value that adjusts the effect of doppler calculations on the sound (emitter).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setDopplerScale(float)"><!-- --></A><H3>
setDopplerScale</H3>
<PRE>
public static void <B>setDopplerScale</B>(float&nbsp;value)</PRE>
<DL>
<DD>Sets a value that adjusts the effect of doppler calculations on the sound (emitter).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDuration()"><!-- --></A><H3>
getDuration</H3>
<PRE>
public <A HREF="../../../../System/TimeSpan.html" title="class in System">TimeSpan</A> <B>getDuration</B>()</PRE>
<DL>
<DD>Gets the duration of the SoundEffect.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="IsDisposed()"><!-- --></A><H3>
IsDisposed</H3>
<PRE>
public boolean <B>IsDisposed</B>()</PRE>
<DL>
<DD>Gets a value that indicates whether the object is disposed.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getMasterVolume()"><!-- --></A><H3>
getMasterVolume</H3>
<PRE>
public static float <B>getMasterVolume</B>()</PRE>
<DL>
<DD>Gets the master volume that affects all SoundEffectInstance sounds.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setMasterVolume(float)"><!-- --></A><H3>
setMasterVolume</H3>
<PRE>
public static void <B>setMasterVolume</B>(float&nbsp;value)</PRE>
<DL>
<DD>Sets the master volume that affects all SoundEffectInstance sounds.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getName()"><!-- --></A><H3>
getName</H3>
<PRE>
public java.lang.String <B>getName</B>()</PRE>
<DL>
<DD>Gets the asset name of the SoundEffect.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setName(java.lang.String)"><!-- --></A><H3>
setName</H3>
<PRE>
public void <B>setName</B>(java.lang.String&nbsp;value)</PRE>
<DL>
<DD>Sets the asset name of the SoundEffect to the specified value.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getSpeedOfSound()"><!-- --></A><H3>
getSpeedOfSound</H3>
<PRE>
public static float <B>getSpeedOfSound</B>()</PRE>
<DL>
<DD>Returns the speed of sound. 343.5 meters per second.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setSpeedOfSound(float)"><!-- --></A><H3>
setSpeedOfSound</H3>
<PRE>
public static void <B>setSpeedOfSound</B>(float&nbsp;value)</PRE>
<DL>
<DD>Sets the speed of sound.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="CreateInstance()"><!-- --></A><H3>
CreateInstance</H3>
<PRE>
public <A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html" title="class in Microsoft.Xna.Framework.Audio">SoundEffectInstance</A> <B>CreateInstance</B>()</PRE>
<DL>
<DD>Creates a new SoundEffectInstance for this SoundEffect. Reference page contains links to related code samples.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="Dispose()"><!-- --></A><H3>
Dispose</H3>
<PRE>
public void <B>Dispose</B>()</PRE>
<DL>
<DD>Releases the resources used by the SoundEffect.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../System/IDisposable.html#Dispose()">Dispose</A></CODE> in interface <CODE><A HREF="../../../../System/IDisposable.html" title="interface in System">IDisposable</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="Dispose(boolean)"><!-- --></A><H3>
Dispose</H3>
<PRE>
protected void <B>Dispose</B>(boolean&nbsp;disposing)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>disposing</CODE> - </DL>
</DD>
</DL>
<HR>
<A NAME="finalize()"><!-- --></A><H3>
finalize</H3>
<PRE>
protected void <B>finalize</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="FromStream(System.IO.Stream)"><!-- --></A><H3>
FromStream</H3>
<PRE>
public static <A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html" title="class in Microsoft.Xna.Framework.Audio">SoundEffect</A> <B>FromStream</B>(<A HREF="../../../../System/IO/Stream.html" title="class in System.IO">Stream</A>&nbsp;stream)</PRE>
<DL>
<DD>Creates a SoundEffect object based on the specified data stream.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>stream</CODE> - Stream object that contains the data for this SoundEffect object.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../System/ArgumentNullException.html" title="class in System">ArgumentNullException</A></CODE> - stream is null.</DL>
</DD>
</DL>
<HR>
<A NAME="FromStream(java.io.InputStream)"><!-- --></A><H3>
FromStream</H3>
<PRE>
public static <A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html" title="class in Microsoft.Xna.Framework.Audio">SoundEffect</A> <B>FromStream</B>(java.io.InputStream&nbsp;stream)</PRE>
<DL>
<DD>Creates a SoundEffect object based on the specified data stream.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>stream</CODE> - InputStream object that contains the data for this SoundEffect object.</DL>
</DD>
</DL>
<HR>
<A NAME="GetSampleDuration(int, int, Microsoft.Xna.Framework.Audio.AudioChannels)"><!-- --></A><H3>
GetSampleDuration</H3>
<PRE>
public static <A HREF="../../../../System/TimeSpan.html" title="class in System">TimeSpan</A> <B>GetSampleDuration</B>(int&nbsp;sizeInBytes,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels)</PRE>
<DL>
<DD>Returns the sample duration based on the specified sample size and sample rate.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sizeInBytes</CODE> - Size, in bytes, of audio data.<DD><CODE>sampleRate</CODE> - Sample rate, in Hertz (Hz), of audio content. The sampleRate must be between 8000 Hz and 48000 Hz.<DD><CODE>channels</CODE> - Number of channels in the audio data.</DL>
</DD>
</DL>
<HR>
<A NAME="GetSampleSizeInBytes(System.TimeSpan, int, Microsoft.Xna.Framework.Audio.AudioChannels)"><!-- --></A><H3>
GetSampleSizeInBytes</H3>
<PRE>
public static int <B>GetSampleSizeInBytes</B>(<A HREF="../../../../System/TimeSpan.html" title="class in System">TimeSpan</A>&nbsp;duration,
int&nbsp;sampleRate,
<A HREF="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html" title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</A>&nbsp;channels)</PRE>
<DL>
<DD>Returns the size of the audio sample based on duration, sample rate, and audio channels.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>duration</CODE> - TimeSpan object that contains the sample duration.<DD><CODE>sampleRate</CODE> - Sample rate, in Hertz (Hz), of audio content. The sampleRate parameter must be between 8,000 Hz and 48,000 Hz.<DD><CODE>channels</CODE> - Number of channels in the audio data.</DL>
</DD>
</DL>
<HR>
<A NAME="Play()"><!-- --></A><H3>
Play</H3>
<PRE>
public boolean <B>Play</B>()</PRE>
<DL>
<DD>Plays a sound. Reference page contains links to related code samples.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>True if successful, false otherwise.</DL>
</DD>
</DL>
<HR>
<A NAME="Play(float, float, float)"><!-- --></A><H3>
Play</H3>
<PRE>
public boolean <B>Play</B>(float&nbsp;volume,
float&nbsp;pitch,
float&nbsp;pan)</PRE>
<DL>
<DD>Plays a sound based on specified volume, pitch, and panning. Reference page contains links to related code samples.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>volume</CODE> - Volume, ranging from 0.0f (silence) to 1.0f (full volume). 1.0f is full volume relative to SoundEffect.MasterVolume.<DD><CODE>pitch</CODE> - Pitch adjustment, ranging from -1.0f (down one octave) to 1.0f (up one octave). 0.0f is unity (normal) pitch.<DD><CODE>pan</CODE> - Panning, ranging from -1.0f (full left) to 1.0f (full right). 0.0f is centered.
<DT><B>Returns:</B><DD>True if successful, false otherwise.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SoundEffect.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/NoAudioHardwareException.html" title="class in Microsoft.Xna.Framework.Audio"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html" title="class in Microsoft.Xna.Framework.Audio"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?Microsoft/Xna/Framework/Audio/SoundEffect.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SoundEffect.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>