List of Figures
Chapter 1: The Lay of the Land
Figure 1.1: How your computer recotds audio.
Figure 1.2: How your computer plays back audio.
Figure 1.3: The algorithmbehind the simplest form of RLE compression
Figure 1.4: Simple additive sound mixing
Figure 1.5: A comparison between FM synth and Wave Table synth.
Chapter 2: Introduction to DirectAudio
Figure 2.1: DirectX Audio mixes secondary buffers into the primary buffer, then out to your speakers.
Figure 2.2: Streaming a big sound file requires loading pieces of it just as they're needed.
Figure 2.3: The global include path settings.
Figure 2.4: A sine wave.
Figure 2.5: When you lock something, you might get two pointers back.
Figure 2.6: Use the fractional part of pos to determine where in the wave you are.
Chapter 3: Wave Audio Playback
Figure 3.1: Overview of the DirectMusic interfoces used for playing sound effects.
Figure 3.2: What happens when you fail to catch an exception.
Figure 3.3: Hypothetical call stack for a game, showing where an error might be thrown and caught.
Figure 3.4: The message box presented by our errorhandling code.
Chapter 4: Loading WAV Files
Figure 4.1: This figure illustrates the file format of a typical uncompressed WAV.
Figure 4.2: The FOURCC character code for RIFF—note the character swapping.
Figure 4.3: After inserting an RC file into your project, you get a new ResourceView tab.
Figure 4.4: Importing a WAV file into your application's resources.
Figure 4.5: Uncheck the external file checkbox to embed your WAV directly in the resource script of your program.
Chapter 5: Control Freak
Figure 5.1: DirectMusic uses several different parameters to control looping of a segment.
Figure 5.2: Sounds that share audio paths also share volume knobs.
Figure 5.3: Windows provides a GUI to the mixer volumes.
Figure 5.4: The mixer API architecture is divided into several different pseudo-objects.
Chapter 6: MIDI Playback
Figure 6.1: A professional MIDI setup might have several different pieces of hardware, all assigned to different MIDI channels.
Figure 6.2: The new class layout for the audio engine.
Figure 6.3: A flowchart of the basic process for using DirectMusic performance events.
Chapter 7: MP3 and WMA Playback
Figure 7.1: What's contained in the four bytes of a frame header.
Figure 7.2: Illustrates the format of the 128-byte long audio tag.
Figure 7.3: The Windows Recorder in all its glory.
Figure 7.4: The Convert Now dialog box.
Chapter 8: Ogg Vorbis Playback
Figure 8.1: Flowchart for using the vorbisfile API.
Chapter 9: CD Audio Playback
Figure 9.1: The process for using the Media Control Interface (MCI).
Figure 9.2: The effects of sending an MCI_SET_DOOR_OPEN command.
Figure 9.3: Synchronous versus asynchronous command execution.
Figure 9.4: Screenshot of this sample's chapter program in action.
Chapter 10: Tracked Music Playback
Figure 10.1: A screenshot of Impulse Tracker, a popular tracked music editor written by Jeffrey Lim.
Figure 10.2: A screenshot of ScreamTracker, another popular tracked music editor, written by Sami Tammilehto.
Chapter 11: Dynamic Music
Figure 11.1: Illustrates the relationship between parts, PChannels, and audio paths in DirectMusic.
Figure 11.2: You choose the instruments in your band from your DLS collections and the GM sound set.
Figure 11.3: The style and groove level tracks tell DirectMusic what pattern to play next.
Figure 11.4: A sequence of notes in a tracker and in sheet music form.
Figure 11.5: The Groove Level Properties dialog.
Chapter 12: Scripts and Effects
Figure 12.1: Clicking the narrow button on the left will enable/disable the entire variation set.
Figure 12.2: The wave properties window.
Figure 12.3: The wave track properties.
Figure 12.4: The final BigCat segment,with both variations active.
Figure 12.5: Adding references to an audio script.
Figure 12.6: The error dialog generated by AssembleErrorInfoString.
Figure 12.7: the audio path editor.
Figure 12.8: Ucheck the Use standard Buffer check - box to add custom effect to your audio path.
Figure 12.9: The Effect Properties dialog for the echo effect.
Chapter 13: 3D Sound Using DirectX Audio
Figure 13.1: The minimum and maximum distances tell DirectX Audio how far away a sound can be heard.
Figure 13.2: The various buffer properties that influence the volume of a sound.
Figure 13.3: In head-relative mode, buffer positions are relative to the listener.
Figure 13.4: A screenshot of this chapter's sample program.
Chapter 14: 3D Sound Using OpenAL
Figure 14.1: Multiple sources can reference the same buffer.
Figure 14.2: Typical flow when using OpenAL
Chapter 15: Advanced Topics in 3D Sound
Figure 15.1: Shows direct path, early reflections, and late reverb.
Figure 15.2: A graph of the three distinct wave types.
Figure 15.3: A screenshot of the Ch25p2_I3DL2EnvEdit or sample program.
Chapter 16: DirectPlay Voice
Figure 16.1: In a peer-to-peer environment with six players, every time you talk, your voice must be sent to the five other computers.
Figure 16.2: In a forwarding server topology, you send your voice data to a central server; the server takes care of sending it to everyone else.
Figure 16.3: If everybody talks at once, even with a voice server, you'll need 40 kpbs of download bandwidth to receive all 5 streams.
Figure 16.4: A mixing server sends each computer a mix of all the voices it needs.
Figure 16.5: CNetConnectWizard's connect dialog.
Figure 16.6: CNetConnectWizard's new game dialog.
Figure 16.7: The sound hardware test wizard.
Chapter 17: Audio Visualization
Figure 17.1: A screenshot of the ch27p1_visuals sample programe.
Figure 17.2: A cosine wave is a sine wave with a different phase.
Appendix A: Creating Dynamic Music
Figure A.1: Click on the toolbar button that looks like a MIDI port to adjust your MIDI configuration.
Figure A.1: A test project that you can use to see if your MIDI input is working.
Figure A.3: The controls to set an instrument's ID, and whether or not it's a drum set.
Figure A.4: Every instrument in a DLS1 collection has points for attack, sustain, decay, and release (ADSR).
Figure A.5: DLS level 2 instruments have delay, attack, hold, decay, sustain, and release points.
Figure A.6: The band editor of DirectMusic Producer.
Figure A.7: Eight-measure background piano part for Pattern1.
Figure A.8: The note properties window.
Figure A.9: The melody part for Pattern1.
Figure A.10: Background and melody parts for Pattern2.
Figure A.11: The part properties window.
Figure A.12: The intro embellishment pattern.
Figure A.13: The break embellishment pattern.
Figure A.14: A simple motif pattern.
Figure A.15: The secondary playback toolbar.
Figure A.16: The chord properties window.