Difference between revisions of "Chili Sound Pack"

From Chilipedia
Jump to: navigation, search
(Tutorial)
(Extra Notes / Errata)
Line 4: Line 4:
 
Here is a [https://youtu.be/lxBpKjAaUOI link to a video] explaining how to integrate the sound module into a framework solution and how to use the <code>Sound</code> and <code>SoundEffect</code> classes. Check the [[#Downloads|downloads]] section below for the necessary stuff to follow along.
 
Here is a [https://youtu.be/lxBpKjAaUOI link to a video] explaining how to integrate the sound module into a framework solution and how to use the <code>Sound</code> and <code>SoundEffect</code> classes. Check the [[#Downloads|downloads]] section below for the necessary stuff to follow along.
  
=== Extra Notes / Errata ===
+
==== Extra Notes / Errata ====
  
In the tutorial video, the constructor for SoundEffect is not fully explained. There are 3 parameters. The first parameter is, as shown in the video, a list of std::wstrings which are the names of .wav files to be loaded. The second parameter is a bool, and if passed in as true, it allows the loading of .wav files to soft-fail (failure to load the file will cause a silent Sound object to be used instead). The third parameter is the standard deviation used to generate the pitch shift for each playback. Larger values create more dramatic swings in pitch.
+
In the tutorial video, the constructor for <code>SoundEffect</code> is not fully explained. There are 3 parameters. The first parameter is, as shown in the video, a list of <code>std::wstring</code>s which are the names of .wav files to be loaded. The second parameter is a <code>bool</code>, and if passed in as true, it allows the loading of .wav files to soft-fail (failure to load the file will cause a silent <code>Sound</code> object to be used instead). The third parameter is a <code>float</code> which is the standard deviation used to generate the pitch shift for each playback. Larger values create more dramatic swings in pitch.
  
 
== Downloads ==
 
== Downloads ==

Revision as of 12:25, 18 November 2016

The Chili Sound Pack is an optional pack of code and .dlls you can add to Chili Framework projects to enable the use of sound effects.

Tutorial

Here is a link to a video explaining how to integrate the sound module into a framework solution and how to use the Sound and SoundEffect classes. Check the downloads section below for the necessary stuff to follow along.

Extra Notes / Errata

In the tutorial video, the constructor for SoundEffect is not fully explained. There are 3 parameters. The first parameter is, as shown in the video, a list of std::wstrings which are the names of .wav files to be loaded. The second parameter is a bool, and if passed in as true, it allows the loading of .wav files to soft-fail (failure to load the file will cause a silent Sound object to be used instead). The third parameter is a float which is the standard deviation used to generate the pitch shift for each playback. Larger values create more dramatic swings in pitch.

Downloads

Here is the sound module zip file with the code and .dll files for the sound module.

To follow the tutorial on the sound module, you will need the following zip files as well:

Inner Workings of the Module

The inner workings of the XAudio2 code are explained in the H.U.G.S. series. The code discussed there is somewhat different than the code in the sound pack, but the fundamentals are the same. If you want the details, see the video links below. Note that these tutorials assume a relatively good command of the C++ language.