Keywords: VB DirectX9 DirectSound 3D Author: Dong Jun to contain information Baidu search DirectSound3D yesterday, really not at all. Surprised.
Google has some or Microsoft. It seems really to fill the domestic blank.
The master is very busy.
======== or more is nonsense =================
At first, the example of Microsoft DSOUND3D is very difficult, mainly the terminology, if the preparation work is not enough, you can say that I can't understand.
From the home, it is necessary to explain it from the home of the DirectX.
========= The following is the text ================
A 3D sound, we can understand as a 3D buffer (buffer)
Studying D3D comrades know that you need to create a scene, then set the vertex, light, camera ...
The DS3D is also similar, and there is a concept. These need to be understood by reality.
1 Sound source is an object of vocal. Many properties (slowly discuss) (Buffer3D)
2 Listenner can understand as the audience, which also has a lot of properties. (Listener3D)
3 There is a variety of relationships between sound sources and audiences, which makes up the scene, and there is no existence in the code. It is reflected in the relationship between the sound source and the audience.
4 Sound sources can be moved, so he has a location (Vector3 position)
5 listeners can also move, he also has a location (Vector3 position)
6 Sound sources are positions with the audience, so there is a distance (distance)
7 Since there is a distance, it can be moved, so there is a speed. (Auxiliary Concept)
8 has the movement of the sound source and the location of the audience, so the DopplerFactor (do not understand? It is close to the object tone becomes high, the opposite is true. Don't understand it? Go see the junior high school material textbook ....)
9 sounds are also characteristic, such as attenuation. The farther distance, the effect is naturally different. (Rolloffactor)
10 There are two sounds: A 360 degree space sound (such as explosion) B has direction sound (such as directionality) For the former, it is important to note that the audience also has these two properties. There are three parts that are divided into three parts that can be imagined into 3 nested cones, sound sources (your mouth) in the vertex position, and the sound of the sound does not feel a strong attenuation in the most inner cone. However, the tapered cone can be obviously felt (close to the inner conical hearing, maybe you will go), and the last thing is not heard. (Maybe you will say that I am shouting in a direction, I can hear it around. It is because the propagation characteristics of the wave and the result of the reflection are the reference model in the DS3D reality. If you can't fully understand it, then you will never enter the DS3D.
Next, enter the code.
Creating associated with device Device will be, and you know that they have their own related parameters, such as ListenerParameters, Listener3DSettings.
Play sound depends on buffer.play ()
The first 3 chapters said how to achieve the difference in sound effects by modifying the parameters of the buffer.
The same is true for DS3D, modifying buffer Application3DSettingS.Position = position; (x, y, z,) Application3DSettingS.Velocity = Velocity; then uses these location parameters ApplicationBuffer3d.allparameters = Application3DSettings;
This is not the same.
In essence, after the initialization completed the DS and DS3D, we started playing, we modified these parameters.
Similar to the modified volume, only the volume we can increase directly from 10 or 5. The modification of three-dimensional coordinates need to be solved with equations. (Maybe use a three-dimensional analysis of geometries)
DS3D is not very difficult, it is to modify coordinate parameters. Other Doppler or attenuation Microsoft has been done (what! You have to do it yourself, then you don't have to read this article)
As for the code, it is more complicated, and the individual believes that Microsoft's example uses too many skills, causing the difficulty of understanding.
Next time I have a simple example, used to end the DS3D.
In order to write code, use so many words to introduce these preparation knowledge is worth it.