Platform SDK: DirectX

Sound Cones

A sound with no orientation is a point source; the amplitude of the sound at a given distance is the same in all directions. A sound with an orientation is a sound cone.

[C++]

In DirectSound, sound cones are made up of an inside cone and an outside cone. Within the inside cone, the volume of the sound is just what it would be if there were no cone; in other words, there is no attenuation from the normal volume. (Of course, normal volume is not necessarily maximum volume. It has already been modified by the basic volume of the buffer—as set by the IDirectSoundBuffer::SetVolume method—as well as by the distance from the listener, the listener's orientation, the rolloff factor, and the buffer's minimum distance value.) Outside the outside cone, the normal volume is attenuated by a specified number of decibels, as set by the application. The angle between the inside and outside cones is a zone of transition from the inside volume to the outside volume.

[Visual Basic]

In DirectSound, sound cones are made up of an inside cone and an outside cone. Within the inside cone, the volume of the sound is just what it would be if there were no cone; in other words, there is no attenuation from the normal volume. (Of course, normal volume is not necessarily maximum volume. It has already been modified by the basic volume of the buffer—as set by the DirectSoundBuffer.SetVolume method—as well as by the distance from the listener, the listener's orientation, the rolloff factor, and the buffer's minimum distance value.) Outside the outside cone, the normal volume is attenuated by a specified number of decibels, as set by the application. The angle between the inside and outside cones is a zone of transition from the inside volume to the outside volume.

The following illustration shows the concept of sound cones.

Technically, any 3-D sound buffer in DirectSound is a sound cone, but by default a buffer behaves like an omnidirectional sound source, because the outside volume is 0 (that is, there is no attenuation), and the inside and outside cone angles are 360 degrees. Until the application changes these values, the sound will not have any apparent orientation.

Designing sound cones properly can add dramatic effects to your application. For example, you could position a sound source in the center of a room, setting its orientation toward an open door in a hallway. Then set the angle of the inside cone so that it extends to the width of the doorway, make the outside cone a bit wider, and set the outside cone volume to inaudible. A listener moving along the hallway will begin to hear the sound when near the doorway, and the sound will be loudest as the listener passes in front of the open door.

[C++]

An application sets or retrieves the angles that define sound cones by using the IDirectSound3DBuffer::SetConeAngles and IDirectSound3DBuffer::GetConeAngles methods. The outside cone angle must always be equal to or greater than the inside cone angle.

To set or retrieve the orientation of sound cones, an application can use the IDirectSound3DBuffer::SetConeOrientation and IDirectSound3DBuffer::GetConeOrientation methods.

An application sets and retrieves the outside cone volume by using the IDirectSound3DBuffer::SetConeOutsideVolume and IDirectSound3DBuffer::GetConeOutsideVolume methods. The outside cone volume is expressed in hundredths of decibels and is a negative value, because it represents attenuation from the default volume of 0.

[Visual Basic]

An application sets or retrieves the angles that define sound cones by using the DirectSound3DBuffer.SetConeAngles and DirectSound3DBuffer.GetConeAngles methods. The outside cone angle must always be equal to or greater than the inside cone angle.

To set or retrieve the orientation of sound cones, an application can use the DirectSound3DBuffer.SetConeOrientation and DirectSound3DBuffer.GetConeOrientation methods.

An application sets and retrieves the outside cone volume by using the DirectSound3DBuffer.SetConeOutsideVolume and DirectSound3DBuffer.GetConeOutsideVolume methods. The outside cone volume is expressed in hundredths of decibels and is a negative value, because it represents attenuation from the default volume of 0.