<li><ahref="../../../../Microsoft/Xna/Framework/Audio/NoAudioHardwareException.html"title="class in Microsoft.Xna.Framework.Audio"><spanclass="strong">Prev Class</span></a></li>
<li><ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html"title="class in Microsoft.Xna.Framework.Audio"><spanclass="strong">Next Class</span></a></li>
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels)</code>
<divclass="block">Initializes a new instance of SoundEffect based on an audio buffer, sample rate, and number of audio channels.</div>
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels,
int loopStart,
int loopLength)</code>
<divclass="block">Initializes a new instance of SoundEffect with specified parameters such as audio sample rate, channels, looping criteria, and a buffer to hold the audio.</div>
<thclass="colFirst"scope="col">Modifier and Type</th>
<thclass="colLast"scope="col">Method and Description</th>
</tr>
<trclass="altColor">
<tdclass="colFirst"><code><ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html"title="class in Microsoft.Xna.Framework.Audio">SoundEffectInstance</a></code></td>
<tdclass="colFirst"><code>static <ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html"title="class in Microsoft.Xna.Framework.Audio">SoundEffect</a></code></td>
<divclass="block">Creates a SoundEffect object based on the specified data stream.</div>
</td>
</tr>
<trclass="rowColor">
<tdclass="colFirst"><code>static <ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html"title="class in Microsoft.Xna.Framework.Audio">SoundEffect</a></code></td>
<tdclass="colLast"><code><strong><ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#FromStream(System.IO.Stream)">FromStream</a></strong>(<ahref="../../../../System/IO/Stream.html"title="class in System.IO">Stream</a> stream)</code>
<divclass="block">Creates a SoundEffect object based on the specified data stream.</div>
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels)</code>
<divclass="block">Returns the sample duration based on the specified sample size and sample rate.</div>
</td>
</tr>
<trclass="altColor">
<tdclass="colFirst"><code>static int</code></td>
<tdclass="colLast"><code><strong><ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html#GetSampleSizeInBytes(System.TimeSpan, int, Microsoft.Xna.Framework.Audio.AudioChannels)">GetSampleSizeInBytes</a></strong>(<ahref="../../../../System/TimeSpan.html"title="class in System">TimeSpan</a> duration,
int sampleRate,
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels)</code>
<divclass="block">Returns the size of the audio sample based on duration, sample rate, and audio channels.</div>
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels)</pre>
<divclass="block">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.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>buffer</code> - Buffer that contains the audio data. The audio format must be PCM wave data.</dd><dd><code>sampleRate</code> - Sample rate, in Hertz (Hz), of audio data.</dd><dd><code>channels</code> - Number of channels (mono or stereo) of audio data.</dd></dl>
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels,
int loopStart,
int loopLength)</pre>
<divclass="block">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.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>buffer</code> - Buffer that contains the audio data. The audio format must be PCM wave data.</dd><dd><code>offset</code> - Offset, in bytes, to the starting position of the audio data.</dd><dd><code>count</code> - Amount, in bytes, of audio data.</dd><dd><code>sampleRate</code> - Sample rate, in Hertz (Hz), of audio data.</dd><dd><code>channels</code> - Number of channels (mono or stereo) of audio data.</dd><dd><code>loopStart</code> - Loop start in samples.</dd><dd><code>loopLength</code> - Loop length in samples.</dd></dl>
<pre>public <ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html"title="class in Microsoft.Xna.Framework.Audio">SoundEffectInstance</a> CreateInstance()</pre>
<divclass="block">Creates a new SoundEffectInstance for this SoundEffect. Reference page contains links to related code samples.</div>
</li>
</ul>
<aname="Dispose()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>Dispose</h4>
<pre>public void Dispose()</pre>
<divclass="block">Releases the resources used by the SoundEffect.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><ahref="../../../../System/IDisposable.html#Dispose()">Dispose</a></code> in interface <code><ahref="../../../../System/IDisposable.html"title="interface in System">IDisposable</a></code></dd>
<pre>public static <ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html"title="class in Microsoft.Xna.Framework.Audio">SoundEffect</a> FromStream(<ahref="../../../../System/IO/Stream.html"title="class in System.IO">Stream</a> stream)</pre>
<divclass="block">Creates a SoundEffect object based on the specified data stream.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>stream</code> - Stream object that contains the data for this SoundEffect object.</dd>
<dt><spanclass="strong">Throws:</span></dt>
<dd><code><ahref="../../../../System/ArgumentNullException.html"title="class in System">ArgumentNullException</a></code> - stream is null.</dd></dl>
</li>
</ul>
<aname="FromStream(java.io.InputStream)">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>FromStream</h4>
<pre>public static <ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffect.html"title="class in Microsoft.Xna.Framework.Audio">SoundEffect</a> FromStream(java.io.InputStream stream)</pre>
<divclass="block">Creates a SoundEffect object based on the specified data stream.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>stream</code> - InputStream object that contains the data for this SoundEffect object.</dd></dl>
<pre>public static <ahref="../../../../System/TimeSpan.html"title="class in System">TimeSpan</a> GetSampleDuration(int sizeInBytes,
int sampleRate,
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels)</pre>
<divclass="block">Returns the sample duration based on the specified sample size and sample rate.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>sizeInBytes</code> - Size, in bytes, of audio data.</dd><dd><code>sampleRate</code> - Sample rate, in Hertz (Hz), of audio content. The sampleRate must be between 8000 Hz and 48000 Hz.</dd><dd><code>channels</code> - Number of channels in the audio data.</dd></dl>
<pre>public static int GetSampleSizeInBytes(<ahref="../../../../System/TimeSpan.html"title="class in System">TimeSpan</a> duration,
int sampleRate,
<ahref="../../../../Microsoft/Xna/Framework/Audio/AudioChannels.html"title="enum in Microsoft.Xna.Framework.Audio">AudioChannels</a> channels)</pre>
<divclass="block">Returns the size of the audio sample based on duration, sample rate, and audio channels.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>duration</code> - TimeSpan object that contains the sample duration.</dd><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><dd><code>channels</code> - Number of channels in the audio data.</dd></dl>
</li>
</ul>
<aname="Play()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>Play</h4>
<pre>public boolean Play()</pre>
<divclass="block">Plays a sound. Reference page contains links to related code samples.</div>
<dl><dt><spanclass="strong">Returns:</span></dt><dd>True if successful, false otherwise.</dd></dl>
<divclass="block">Plays a sound based on specified volume, pitch, and panning. Reference page contains links to related code samples.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><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><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><dd><code>pan</code> - Panning, ranging from -1.0f (full left) to 1.0f (full right). 0.0f is centered.</dd>
<dt><spanclass="strong">Returns:</span></dt><dd>True if successful, false otherwise.</dd></dl>
<li><ahref="../../../../Microsoft/Xna/Framework/Audio/NoAudioHardwareException.html"title="class in Microsoft.Xna.Framework.Audio"><spanclass="strong">Prev Class</span></a></li>
<li><ahref="../../../../Microsoft/Xna/Framework/Audio/SoundEffectInstance.html"title="class in Microsoft.Xna.Framework.Audio"><spanclass="strong">Next Class</span></a></li>