Keywords: VB DirectX9 DirectSound 3D Author: Dong Gangjun
Yesterday went to Baidu to search directsound3d information, really not a bit. Oh, surprise.
Google has some, or Microsoft's. It seems really to fill the gaps in the country.
The master door seems to be very busy AH.
======== above is nonsense ================
It's hard to start by looking at Microsoft Dsound3d, which is mostly about terminology, and if you're not doing enough, you can hardly read it.
A quick reading of DirectX from home appears to be necessary for explanation.
========= The following is the text ===============
A 3D sound that we can understand as a buffer of 3D
The comrades who study D3D know that they need to create a scene and then set the vertex, light, camera ...
Ds3d is similar and has a general concept. These need to be connected with the reality of understanding.
1 sound sources are audible objects. Have a lot of attributes (talk Slowly) (Buffer3D)
2 Listenner can be understood as listeners, and also have many attributes. (Listener3D)
3 The source and the audience have a variety of relationships, which constitutes the scene, and then the code does not exist, is through the relationship between the sound source and the audience embodied.
4 sound source can be moved, so he has a position (Vector3 position)
5 listeners can also be moved, he also has a position (Vector3 position)
6 sound sources and listeners have positions, so there is a distance (distance)
7 because of the distance and can move, so there is speed. (Auxiliary concepts)
8 has the sound source movement and the listener's position, therefore has the Doppler effect (Dopplerfactor)
(Don't understand?) It is that the approaching object has a higher pitch and the opposite is left. Don't you understand? Take a look at junior high school material textbook .... )
9 sound also has characteristics, such as attenuation. The farther away, the effect is naturally different. (Rollofffactor)
10 there are two kinds of sounds: a 360-degree space sound (such as an explosion) B has a directional sound (such as the direction of speech)
For the former, it should be noted that the audience also has these two attributes.
With the direction of the divided into 3 parts can be imagined as 3 nested cone, sound source (your mouth) in the vertex position, the sound emitted in the most internal cone does not feel a strong attenuation. But the outside of the cone can be clearly felt (near the inner cone to hear more clearly, perhaps you will go in), the last remaining is not heard.
(Perhaps you will say that in real life I shout in a direction, all around can hear.) That's because of the propagation characteristics of the waves and the results of the reflection.
The above is the reference model in Ds3d reality. If the above you do not fully understand, then you can never enter the DS3D.
Next, enter the code.
Creating associations with device device everyone will, and know that they all have their own parameters related to the class, such as Listenerparameters,listener3dsettings
Play sound depends on Buffer.play ()
The first 3 chapters are about how to change the parameters of the buffer to achieve different sound effects.
Ds3d is also the case, modify the buffer
Application3dsettings.position = Position; (x,y,z,)
application3dsettings.velocity = Velocity;
And then take advantage of these positional parameters
Applicationbuffer3d.allparameters = application3dsettings;
It's not the same sound you hear.
Essentially, after initializing the DS and Ds3d, we'll start playing, and we're modifying these parameters.
Similar to the volume of the modification, except that we can increase the volume directly by 10 or 5 less. And the modification of three-dimensional coordinates needs to be solved by equations.
(may use the knowledge of three-dimensional analytic geometry)
Ds3d understanding is not difficult, it is to modify the coordinate parameters. Other Doppler or attenuation Microsoft has done it (what!) You have to do it yourself, so you don't have to read this.
As for the complexity of the code, the individual believes that Microsoft's example uses too many techniques to make it more difficult to understand.
Next time I'll make a simple example of myself to end the Ds3d chapter.
In order to write code, it is worthwhile to introduce these preliminary knowledge with so many words.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.