0:00:00.290,0:00:02.790 The Audio Listener component is the equivalent 0:00:02.790,0:00:04.335 of your ears in the game. 0:00:04.771,0:00:07.616 It receives, or listens, to audio sources 0:00:07.616,0:00:08.844 that are in the game world. 0:00:09.238,0:00:11.657 The control of the audio's behaviour is done on 0:00:11.657,0:00:13.201 the audio source component 0:00:13.201,0:00:16.116 and therefore the listener itself has no settings. 0:00:17.436,0:00:20.469 This is attached to a camera in your scene by default 0:00:20.469,0:00:22.469 but can be placed on any object. 0:00:22.691,0:00:24.691 Often this is attached to a character 0:00:24.691,0:00:26.946 and crucially there can be only one listener 0:00:26.946,0:00:29.814 per scene in order for it to function correctly. 0:00:29.950,0:00:33.131 You can test an audio listener from any position in the world 0:00:33.131,0:00:35.131 by moving the scene camera around 0:00:35.131,0:00:38.324 with the audio preview toggle enabled. 0:00:54.115,0:00:56.492 This gives you live testing of audio sources 0:00:56.492,0:00:58.614 in your environment without having to move 0:00:58.614,0:01:00.991 the real listener or play test the game. 0:01:02.912,0:01:05.951 Audio sources are components that playback audio. 0:01:06.192,0:01:08.459 Think of them as speakers in the game world. 0:01:08.608,0:01:12.021 In this example our turbine has an audio source attached 0:01:12.021,0:01:14.795 with the turbine audio clip that's been applied to it. 0:01:14.917,0:01:17.101 We can assign a clip by dragging and dropping, 0:01:17.101,0:01:19.886 or by using code to select a clip to play. 0:01:19.997,0:01:22.560 We can mute, bypass any filters, 0:01:22.560,0:01:25.167 choose whether to play this audio source on awake, 0:01:25.167,0:01:27.009 as in - when the game begins 0:01:27.009,0:01:28.567 and whether to loop the clip. 0:01:28.567,0:01:32.180 Priority varies between 0 and 255, 0:01:32.180,0:01:34.407 0 being the highest priority. 0:01:34.828,0:01:38.035 It's advisable to have music set as the highest priority 0:01:38.035,0:01:39.856 to avoid other clips from overriding 0:01:39.856,0:01:41.602 when many clips are being played at once. 0:01:41.724,0:01:43.912 Volume determines how loud the clip is played 0:01:43.912,0:01:45.490 based on it's original waveform. 0:01:45.740,0:01:47.740 Pitch controls the pitch of a clip. 0:01:47.999,0:01:49.857 If you're working with 3D sounds 0:01:49.857,0:01:51.412 the settings are more detailed. 0:01:51.595,0:01:53.970 Doppler level defines how much the Doppler Effect 0:01:53.970,0:01:54.824 will be used. 0:01:54.894,0:01:57.693 This is a perceived shift in frequency as the listener 0:01:57.693,0:01:59.693 or the ear in real terms 0:01:59.693,0:02:01.693 is moving past the sound source. 0:02:02.075,0:02:04.075 It will seem higher approaching it 0:02:04.075,0:02:06.075 and lower as it moves away. 0:02:06.429,0:02:09.178 Think of an emergency vehicle's siren as it passes you 0:02:09.178,0:02:09.997 for example. 0:02:09.997,0:02:12.473 Volume roll-off determines the type of roll-off 0:02:12.473,0:02:14.111 to be used by the sound 0:02:14.111,0:02:15.970 as the listener moves away from it. 0:02:16.041,0:02:18.788 This can be logarithmic, linear, 0:02:18.788,0:02:22.508 or customised manually using a curve 0:02:22.508,0:02:24.508 and adding keys as shown. 0:02:29.789,0:02:31.789 The minimum distance defines how close 0:02:31.789,0:02:33.362 to play the sound at full volume. 0:02:33.362,0:02:35.362 So if you are designing 3D sound 0:02:35.362,0:02:38.009 use this value to make the sound source louder. 0:02:39.003,0:02:41.483 This can be adjusted using the spherical Gizmo 0:02:41.483,0:02:42.776 in the scene view. 0:02:48.903,0:02:50.903 And it works in the conjunction with the 0:02:50.903,0:02:52.903 maximum distance setting below, 0:02:52.903,0:02:55.649 which by default is set to 500 metres 0:02:55.649,0:02:57.901 and is a distance after which 0:02:57.901,0:02:59.668 the sound rolls off. 0:03:04.334,0:03:07.734 Pan level defines how truly 3D the sound is. 0:03:08.123,0:03:10.123 This defaults to 1 for 3D sound 0:03:10.123,0:03:12.302 making it fully panned when the stereo listener 0:03:12.302,0:03:13.039 is moved past it. 0:03:13.303,0:03:15.570 Spread is the control of the angle of spread 0:03:15.570,0:03:18.430 from 3D stereo to multichannel sound. 0:03:19.209,0:03:22.146 Finally for 2D sound pan can be controlled 0:03:22.146,0:03:23.465 at the bottom of the component. 0:03:23.631,0:03:25.430 As a rule elements such as music 0:03:25.430,0:03:27.014 should be set to 2D sound, 0:03:27.014,0:03:28.944 whilst diegetic sound that should be 0:03:28.944,0:03:30.982 fading realistically should be set up 0:03:30.982,0:03:33.418 as 3D and positioned accordingly. 0:03:33.723,0:03:35.863 The 2D and 3D values of a sound 0:03:35.863,0:03:38.867 are controlled by an audio clip's import settings. 0:03:39.915,0:03:41.915 When selecting a clip in the project 0:03:41.915,0:03:43.592 you will be able to see the import settings 0:03:43.592,0:03:44.511 in the inspector. 0:03:44.511,0:03:47.149 You can choose the audio format to use, 0:03:47.149,0:03:50.105 whether it should be 3D or 2D sound, 0:03:50.105,0:03:53.268 whether you want to force your stereo sound to mono, 0:03:53.268,0:03:56.972 how to load it and what compression to use. 0:03:57.305,0:03:59.636 You can also preview sound at the bottom, 0:04:01.193,0:04:03.193 choose whether to loop whilst previewing 0:04:04.756,0:04:06.756 and set the inspector to auto-play 0:04:06.756,0:04:08.756 whilst browsing through clips.