shown in other instead.
Emulating the real-life sound, it should be considered that all sounds are emitted from a specific source, travel through some space and then perceived by the listener. Here comes a lot of factors into a play, such as characteristics of the propagation medium (such as air or water), characteristics of the sound itself, geometry of the space. But in the first place the resulting sound depends on the relative positions of sound sources and the listener. Spatialization determines the filtering of high frequencies for the left or right channels when the listener is turned to the corresponding side. If the sound is heard from behind, it becomes muffled using the same principle. Therefore, it is of key importance to correctly place the sources into the scene and orient the listener if necessary.
Unigine enables the same general functionality for the sound sources as for other nodes: they can be easily moved, rotated or scaled. Besides that, the undermentioned specific characteristics can be edited.
Creating a Sound Source#
To create a sound source via UnigineEditor:
- In the Menu bar, click Create -> Sound -> Source.
- Place the sound source somewhere in the world.
Pitch is a basic parameter corresponding to the frequency of a sound wave. A sound wave, like any other wave, is introduced into a medium by a vibrating object. The frequency of a wave refers to how often the particles of the medium vibrate when a wave passes through it. So the faster the vibration, the higher is the pitch.
The pitch of a sample can be changed to the by shifting the frequency of the sound.
- The initial value 1 means there is no shift applied and the sound pitch remains unchanged.
- With each reducing by 50 percent, the pitch is shifted one octave down (drop of 12 semitones).
- With each doubling, the pitch is shifted one octave up (12 semitones increase).
Another distinct characteristic of the perceived sound is its loudness. Gain is a scalar multiplier for the sound amplitude (hight of the wave) determining if the sound should be attenuated.
- By default the gain equals 1, which means sound is not attenuated and preserves its original amplitude.
- Setting the gain to 0.5 will result in attenuation of 6 dB.
- Zero value mutes the sound source completely.
A sound with no orientation has the same amplitude at a given distance in all directions. But it can be focused to a narrow beam and emitted only in one specified direction. To visualize this directional spread of a sound wave, the oriented cone is used. The vertex of the cone is the source itself. The direction of the oriented cone is changed by rotating the node. The inner and outer angles divide the area of sound coverage into the following zones:
- The inner cone is defined by the inner angle. If the angle equals 360 degrees, the sound source is omnidirectional. When inside the inner cone, the listener perceives the direct sound. It means that its loudness is specified by gain and no additional attenuation besides the distance-related one is applied.
- The outer cone is defined by the outer angle. If set to 360 degrees, the outer angle covers the entire world. if the inner angle is also 360, the zone for angle dependent attenuation equivalent to the directional sound is zero. The gain in the outer cone is linearly extrapolated between the general gain and outside the cone gain values. It enables imitating smooth and gradual attenuation of sound.
- The outside zone is the remaining sphere volume that is not included in the oriented cone. The sphere itself is limited to the maximum distance. The sound can still be heard outside the cone, but its attenuation must be different, meaning a separate gain value should be set.
The outer gain is the factor with which the general gain is multiplied to determine the effective gain in the outside zone. It has to be noticed, that while changing the general gain result in sound attenuation in all zones and directions, the outer gain affects only the outside zone. By default the outer gain value equals 0 and the sound coverage is limited to the oriented cone.
Outer Gain HF#
Cone outer gain HF enhances the source's directivity by filtering high frequencies in the zone outside the cone (in the rear of the source). The underlying reason of this parameter is that sounds in real world are more directive at high frequencies than at low ones.
- The default 1.0 means that no additional filtering of high frequencies is applied.
- At the minimum setting of 0.0, high frequencies are attenuated by 100 dB more than the low frequencies.
Minimum and Maximum Distance#
The amplitude of the sound decreases with the distance. As the listener moves away from the source, at some point it becomes completely out of hearing range. This point corresponds to the maximum distance. If the maximum distance is set to infinity, it prevents the sound source to become inaudible regardless of the listener's position in the virtual world.
On the other hand, approaching the source will result in sound getting louder: the volume doubles when the distance is halved. However, at some point the sound will get as clear, as it should be, and further increasing of the volume is not valid. This point past which the source is unattenuated is equivalent to the minimum distance.
The minimum and maximum distances are very useful for compensating for the difference in absolute volume levels of the sounds. For example, the sounds of a jet plane and a bee are recorded with approximately the same absolute volume, though being of different intensity in the real life. If the minimum distance for the plane is set to 100 units and for the bee to 0.2 units (if the scale is congruent to meters), the sounds will be perceived as balanced in proportions.
The Doppler effect is a shift of the sound wave frequency (pitch change) depending on the velocities of the source and listener relative to the medium, and the propagation speed of sound in that medium. The received frequency is higher when compared to the emitted one if the source is approaching the listener, identical at the moment of passing by, and lower during moving off. The Doppler effect is applied to the sound sources automatically.
When a sound source is positioned in the reverberating environment, sometimes it is necessary to gain a proper reverberation modulation for the selected sound source. The following reverb-related parameter can be fine-tuned: room rolloff. It defines attenuation of the reverberation sound over distance. It is absolutely concurrent to the appropriate parameter of reverberation zone, except being limited to the only source.
Air absorption controls the filtering of high frequencies of emitted sound caused by the propagation medium. With the help of this parameter, the atmospheric conditions for the source can be altered when comparing to the environment. Increasing air absorption can imitate the sound coming from a cloud of fog or smoke (more humid atmosphere). Air absorption is a multiplier for the fixed value of 0.994 (-0.05 dB) per unit which represents normal atmospheric humidity and temperature. The parameter value can be set between 0 and 10 giving a range of 0 to 50 mb of attenuation at the reference high frequency per unit.
- By default the air absorption is set to 0 and high frequency attenuation is disabled.
- If the parameter value is set to 1.0, high frequency attenuation of the emitted sound is applied at a rate of 0.05 dB per unit.
Simulating sound occlusion is substantial for true-to-life auditory experience. Moving through the world, listener can get into a place from where the sound source is not seen directly. Imagine a source located behind the wall: it would still modulate the listener's adjacent sound environment, though naturally being not so clearly heard. Any sounds passing from the source to the listener must pass through the wall muffling them and serving as a filter. The sound wave from the source (along with accompanying reflections and reverberation) when it hits the wall and passes through to the other side becomes altered. The high frequencies are usually removed, leaving a very muffled result. Besides the mentioned physical effect, this occluded sound wave will also add to the reflected sound in the listener's environment.
Occlusion can be enabled and disabled for each sound source individually, selective occlusion adjustment is performed using occlusion bit masks which determine which sound sources are occluded by each particular surface of scene objects. Each surface also has an occlusion coefficient, that determines how much it affects sounds in case of occlusion:
- 0.0 - no occlusion, sound volume will stay the same in case of occlusion by the surface.
- 1.0 - maximum occlusion, sound will not be heard at all in case of occlusion by the surface.
The following standard options for the sample sound playback are available: play, stop or pause. The playing can also be looped by checking the appropriate box.
- A SoundSource class to manage sound sources via API