Games Development Practices Sound Effects

Slides:



Advertisements
Similar presentations
Prepared By: Shakil Raiman.  Sound waves are longitudinal waves  Sound waves are produced by vibration of objects.  Here the loudspeaker vibrate and.
Advertisements

CHAPTER 16 Audio © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –The fundamentals of sound – –DirectX Audio.
Sound waves Pg. 45 in NB.
AMPLITUDE, WAVELENGTH, FREQUENCY AND PITCH. REVISION.
Section  The Doppler Effect: A change in frequency (pitch) due to relative motion between a source of sound and its observer.
1 Waves and Vibrations 2 Common Wave Characteristics: Waves come in many types: water, sound, radio, light, etc.
17.4 Sound and Hearing Sound waves are longitudinal waves that travel through a medium. Many behaviors of sound can be explained by using a few properties:
Art 321 Sound, Audio, Acoustics Dr. J. Parker. Sound What we hear as sound is caused by rapid changes in air pressure! It is thought of as a wave, but.
Basics of Digital Audio Outline  Introduction  Digitization of Sound  MIDI: Musical Instrument Digital Interface.
Go to section Interest Grabber Vibrations A wave is a vibration that carries energy from one place to another. But not all vibrations are waves. Hold a.
Waves A repeating movement or disturbance that transfers energy...
Games Development Practices Sound Effects & OpenAL CO2301 Games Development 1 Week 15.
Sound Vibration and Motion.
Sound
Phy 103: Fundamentals of Physics III Chapter 20: Sound Lecture Notes.
What What is is SOUND?SOUND? Sound is longitudinal pressure waves that travel through elastic media.
Sound and Hearing Properties of Sound Waves, Ultrasound, The Doppler Effect.
Sound and Digital Sound v © Allan C. Milne Abertay University.
10.2 Essential Questions How is sound intensity measured?
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
SOUND SECONDARY 3 PHYSICS. NATURE AND PRODUCTION OF SOUND Sound is….. A form of energy an example of longitudinal wave Produced by vibrating sources placed.
Chapter 12 Review. Explain how waves are produced Vibration of an object is what produces sound waves. The vibrating object moves in one direction and.
SOUND Sounds are a form of energy produced by rapidly vibrating objects. Sound needs a material medium for its transmission. Sound cannot travel through.
Digital Audio I. Acknowledgement Some part of this lecture note has been taken from multimedia course made by Asst.Prof.Dr. William Bares and from Paul.
Sound waves Pg. 65 Sound waves Pg. 65. Objectives Investigate and analyze characteristics of sound waves: frequency, wavelength, and amplitude. Examine.
Lecture #28: Waves and Sound AP Physics B. wave direction What is a wave? A wave is a traveling disturbance. A wave carries energy from place to place.
Wave Properties. Amplitude The distance a wave vibrates from its rest position. The distance a wave vibrates from its rest position. The greater the amplitude,
~ Sound ~ The Nature of Sound  Speed of Sound  Human hearing  Doppler effect  “Seeing” with sound.
3.3 Fundamentals of data representation
The Doppler Effect THE LAST LECTURE.
10.2 Essential Questions How is sound intensity measured?
Sound waves Sound is a form of energy produced and transmitted by vibrating matter Medium - The stuff (matter) through which waves move.
Mechanical Waves and Sound
WAVES.
Introduction to Digital Audio
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
The Behavior of Mechanical Waves
Transverse/Longitudinal waves
Examples of wave superposition
Pg. 298 – Damping Underdamping Overdamping
Sound.
Sound COS: #18 Use Models to determine how light and sound waves differ in how they are absorbed, reflected, and transmitted through different media.
Waves & Sound A. Waves 1. The nature of waves
WAVES.
The Physics of Sound.
Introduction to Digital Audio
Sound Waves What's Happening? Wave Basics Wave Behaviors Sound Changes
Sound and Hearing it.
Chapter 12 Sound.
Notes 21.1 – Properties of Sound
Sound!!.
Introduction to Digital Audio
Sound Review 2017 Answers.
Representing Sound 2.6 – Data Representation.
11: Wave Phenomena 11.2 The Doppler Effect.
Presented by Kesler Science
Sound and HOW WE Hear it.
Assist. Lecturer Safeen H. Rasool Collage of SCIENCE IT Dept.
1. Which of the following is a false statement?
5th Grade Amazing Earth January
Waves Wave Properties Wave Interactions Sound Waves
Mechanical Waves © 2014 Pearson Education, Inc..
All sounds are produced by the vibration of matter
Recap In previous lessons we have looked at how numbers can be stored as binary. We have also seen how images are stored as binary. This lesson we are.
Sound Chapter 12.
Sound Waves, Pitch, and Loudness
Games Development 1 Review / Revision
Chapter 12 Notes.
Sound.
Sound and Hearing it.
Presentation transcript:

Games Development Practices Sound Effects CO2301 Games Development 1 Week 17

Today’s Lecture What is Sound Digital Sound Representation Stereo / 3D Sound Special Effects DirectSound

What is Sound? Sound is caused when a vibrating object creates waves of pressure. These waves travel through the air (or other medium) Speed of sound in air ~340 m/s Water 1480m/s, Steel 4000m/s The waves radiate outwards from their source in a spherical manner The pressure waves diminish with distance

How do we Perceive Sound? Our ears are very sensitive to such pressure waves The volume of a sound is determined by the amount of pressure variation the amplitude of the waves The pitch of a sound (how high or low it is) is driven by how quickly the pressure varies the frequency of the waves Louder Quieter Higher Pitched

Waveforms Draw waveforms to represent the pressure variation created at the source Simple waveforms (like the last few) make very simple sounds Real-world sounds have much more complex waveforms And waveform is densely packed Computers cannot store these analogue waveforms, they use a digital representation instead… Acoustic Guitar Electric Guitar Guitar Clip

Sampling a Sound A computer stores a sound by sampling the waveform A sample is just the measurement of a waveform at a given time Samples taken at a fixed sample frequency (rate) e.g. CDs sampled at 44100Hz : 44100 samples / second Each sample is a value representing the amplitude (pressure) of the waveform at that point Samples are usually integers Hence they have a max/min value – not realistic

Digital Sound Quality Higher sample rates result in a better approximation to the original sound and hence a better quality sound Nyquist criterion: sample rate must be greater than 2 x required max frequency in the sound Typical sample frequencies: 11,000->48,000Hz The bit-depth of the samples is the number of bits used for each sample and determines the accuracy of each sample E.g. An 8-bit, 16-bit or even floating point value for each sample A higher bit-depth will also improve digital sound quality But improvement is less than the effect of increasing sample rate

Stereo Sound Each ear receives a different waveform from a single sound If the sound is off-centre then the sound waves will reach one ear sooner (and louder) Also, our head is an obstacle for the pressure waves and they distort when passing by So the position of the head relative to the sound affects the received waveforms at each ear We can model this difference by recording stereo sound: 2 waveforms, one for each ear Greatly improves sound quality But pre-recorded sound is statically positioned…

3D Sound Can dynamically model the different sounds received by our ears: We first consider the 3D position of the sound source Then calculate how the sound emitted will be perceived at each ear of the observer Need to take account of: The 3D position of the sound relative to the observer The head position (HRTF – head related transfer functions are used here) Any obstacles in the way (e.g. walls) These calculations can be performed in hardware Can then model dynamic sound in our 3D scenes

The Doppler Effect We have considered the relative 3D position of a sound source But the relative velocity also has an effect on the perceived sound: Sounds moving towards an observer are higher in pitch Those moving away are lower in pitch The waves are compressed / stretched by the movement: This should also be modelled to create a compelling 3D sound Also typically supported in hardware Animation by Dr. Dan Russell, Kettering University

Other Special Effects There is other special processing we may perform on a waveform: Echo, reverberation, distortion, etc. Involve numeric processing of the samples Reverberation is most interesting for games The reflection and damping of a sound against the walls and furniture of a environment We often apply an environmental reverberation to all sounds depending on the current scene Basic Sound Church Bathroom

Sound Effect Libraries We will use SFML in the labs to add sound to projects It is a “media layer” to make cross-platform development easier Its audio code uses the OpenAL Soft library Introduces several concepts Sound Buffers: A buffer holds sound data in memory Creating a buffer doesn't play a sound Equivalent to meshes in the TL-Engine Sounds An actual sound positioned in the world. Must be associated with a buffer Equivalent to models in the TL-Engine The Listener, also positioned in the world

OpenAL Basics Buffers, sounds & listener have properties: Buffers: Sample rate, bit depth, and other source data related properties – we don’t generally adjust these Sounds: Pitch, volume, looping, position, velocity, etc. The Listener Position, orientation, velocity, master volume Relative position of source / listener used to determine how to play sound out of speakers Velocity is used to generate Doppler effect N.B. SFML does not support Doppler, but Open AL Soft does

Sound APIs DirectSound is part of the DirectX SDK Long deprecated now, may see in old projects / websites XAudio2 is DirectSound’s replacement Windows and Xbox, powerful but proprietary & complex FMOD Ex is widely used for games Supports all platforms (Windows, Linux, Consoles, Mobile) High level API for large projects, older low-level API available OpenAL Soft Open source, cross-platform software-driven low-level API SFML and SDL2 are cross-platform media APIs SFML has nice C++ interface SDL2 is very widely used, supports more platforms (iOS, Android)