Sound Effects

Windows Media Encoder SDK banner art

In this scenario, you want to provide nonmusical sounds that can be played on demand to reflect actions in a game or other application. Such sounds could range from short sound effects to longer pieces of dialog.

Several techniques are available for creating sound effects by using DirectMusic Producer:

  • Compose wave-based segments for individual sounds. By using variations, you can create more realistic effects that do not always sound exactly the same.
  • Create custom DLS instruments. Applications can then trigger sound effects by playing notes, and can change the timbre of the sound by altering the pitch and velocity of the notes.
  • Combine custom DLS instruments with style-based segments. The style contains different patterns for different ranges of groove level. Each pattern might contain only a single note in a single part, mapped to one instrument containing a sound effect. The application triggers appropriate sounds by setting a groove level and playing the segment. This approach could be used, for example, to play crowd noises varying from groans to wild applause.

When implementing this scenario, consider the following:

  • If the timing of sound effects is critical and the application requires the least possible delay between triggering a sound effect and hearing it, application developers should consider playing wave files directly through DirectSound buffers rather than using DirectMusic Producer content.
  • DLS samples can be one-shot or looping. Use looping samples for continuous effects such as engine sounds.
  • You can use DLS Designer to save sound effects in compressed formats, achieving a dramatic reduction in the storage required for waves.
  • Another advantage of using DLS for sound effects is that articulation or envelope effects are automatically applied when the sound is played. For example, a crowd noise can have attack and fade.
  • If the application is using 3-D sounds, each part within a segment should be assigned to its own mix group so that it plays through a unique 3-D buffer. The application can then place sound sources individually.
  • Use environmental reverberation to make sound effects more realistic. You can attach this effect to an audiopath, or it can be applied by the application.

Concepts

How-to