1 / 19

4 . 3. Sound

4 . 3. Sound. Use of sound within games. Question Clinic: FAQ. In lecture exploration of answers to frequently asked student questions. Sound in Games. Overview of the different uses of sound within games. Use of sound in game. The use of sound within games includes:

arnav
Télécharger la présentation

4 . 3. Sound

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 4.3.Sound Use of sound within games

  2. Question Clinic: FAQ In lecture exploration of answers to frequently asked student questions

  3. Sound in Games Overview of the different uses of sound within games

  4. Use of sound in game The use of sound within games includes: Music - establishing scene mood, e.g. uplifting, urgent, peaceful, etc. Sound effects - dependent sounds tied to in-game events, e.g. collecting power-ups, jumping, etc. Dialog – recorded/generated speech used within cut-scenes (furthering plot) or in-game (improving realism, emersion, etc.).

  5. The importance of sound Sound plays a very important role in setting the mood for the game as well as, increasingly, how engaging the game is. For example: A pinball game without any sound (ball hits, accumulating score) will appear dull and lifeless (the player will feel more detached). In a 3D game, character movement without footfall sounds will reduce the believability/emersion (consciously, or not, the player will feel movement is not ‘right’).

  6. Sound Management Basic principles behind managing sound playback

  7. Output channels Sound hardware typically supports a maximum number of audio output channels (simultaneous sounds). Additionally, sound APIs may support a maximum number of output channels. The number of channels defines the maximum number of simultaneously playing sounds. Aside: “The Java Sound API provides support for the capture, processing, and rendering of audio and MIDI data. Java Sound … is a 16-bit, 32-channel audio rendering and MIDI controlled sound synthesis engine.”

  8. Output channels (a limited resource? Example 1) Constraint: You cannot have more individual sounds playing than you have channels. Actually, 32+ channels is ample for most games… Background music People talking Water sounds Foot falls

  9. Output channels (a limited resource? Example 2) What happens if every projectile from a ship is to make a sound when it hits something? This could be a problem…

  10. Dealing with a large number of concurrent sounds… Question: Given a finite number of channels, how can we deal with a potentially large number of simultaneous sounds? Start 10 mins 9 mins 8 mins 7 mins 6 mins 5 mins 4 mins 3 mins 2 mins 1 min 30 sec Finished

  11. Dealing with a large number of concurrent sounds… Total 32 channels Approach 1: Allocate a maximum number of sound channels that can be used for a particular type of sound. Develop a manager that dynamically monitors channel usage (imposing sound type channel restriction if all channels are in use) Issues: When the playback limit is reached, how are new requests handled? Are they ignored? Is playback of the longest playing sound in that class cut short? If other classes have exceeded their maximum, which one will contract? Projectile hits (max 10 channels) Explosions (max 6 channels)

  12. Dealing with a large number of concurrent sounds… Approach 2: As sound waveforms are additive, software/hardware can be used to combine separate waveforms to be then played via a single output channel. This effectively provides an unlimited number of channels, but with the additional cost of combining the individual sounds. Aside: Approach 1 and 2 can be successfully combined together.

  13. Sound in Java Overview of sound usage in Java

  14. Sound in Java Sound playback is achieved using the Java sound API, using: SourceDataLine – referring to a source of data for a mixer (i.e. output from a program) TargetDataLine – referring to a source of output from a mixer Clip – a loaded (not streamed) sound file. LineListener –attached to lines to monitor LineEvents (i.e. audio opened, closed, started, or stopped)

  15. To do: Explore this • Sound in Java See the following classes within the core code repository: ● SoundAsset ● SoundAssetClip ● SoundAssetAssembly

  16. Sound in XNA Overview of sound usage in XNA

  17. Sound in XNA (XAct) XNA audio is created using the Cross-Platform Audio Creation Tool (XACT). XACT supports WAV, AIFF, XMA formats and stero or 5.1 output XACT provides excellent audio integration features and supports streaming support and audio event notification Aside: To play MP3s (and similar formats) it will be necessary to convert them into a WAV format). This applies to XNA and Java

  18. To do: Explore this • Sound in XNA (XAct) Audio within XACT is structured as follows: Wave Banks – a collection of wave files Sound Banks – instructions and cues for the playback of sounds in a wave bank Cues – triggering audio playback from a sound bank. A cue can contain a sequence of ordered sounds to play, or a list from which to select a random sound to play. audioEngine = new AudioEngine(audioParameters); waveBank = new WaveBank(audioEngine, @“Assets\WaveBank.xwb"); soundBank = new SoundBank(audioEngine, @“Assets\SoundBank.xsb"); soundBank.PlayCue(Name); Cue cue = soundBank.GetCue(Name); cue.Play();

  19. Summary Today we explored: • Overview of the use of sound within games and how sounds can be managed • Overview of Java/XNA sound classes To do: • Think about the role of sound in your game (how important do you want it to be?) • Continue developing visual/aural design of game • Continue writing code to display graphics or play sound

More Related