Class DirectSound3dBuffer
public class DirectSound3dBuffer implements
IDirectSound3dBuffer
{
// Methods
public void getAllParameters(DS3dBuffer buffer);
public void getConeAngles(int[] inCone, int[] outCone);
public void getConeOrientation(D3dVector orientation);
public void getConeOutsideVolume(int[] coneOutsideVolume);
public void getMaxDistance(float[] maxDistance);
public void getMinDistance(float[] minDistance);
public void getMode(int[] mode);
public void getPosition(D3dVector position);
public void getVelocity(D3dVector velocity);
public void setAllParameters(DS3dBuffer buffer, int applyFlag);
public void setConeAngles(int inCone, int outCone, int applyFlag);
public void setConeOrientation(float x, float y, float z,
int applyFlag);
public void setConeOutsideVolume(int coneOutsideVolume,
int applyFlag);
public void setMaxDistance(float maxDistance, int applyFlag);
public void setMinDistance(float minDistance, int applyFlag);
public void setMode(int mode, int applyFlag);
public void setPosition(float x, float y, float z, int applyFlag);
public void setVelocity(float x, float y, float z, int applyFlag);
}
public void getAllParameters(DS3dBuffer buffer);
Retrieves information that describes the 3D characteristics of a sound buffer at a given point in time.
Return Value:
No return value.
Parameter | Description |
buffer
| The DS3dBuffer that will contain the information describing the 3D characteristics of the sound buffer.
|
public void getConeAngles(int[] inCone, int[] outCone);
Retrieves the inside and outside angles of the sound projection cone for this sound buffer.
Return Value:
No return value.
Parameter | Description |
inCone
| The inside angles of the sound projection cone.
|
outCone
| The outside angles of the sound projection cone.
|
public void getConeOrientation(D3dVector orientation);
Retrieves the orientation of the sound projection cone for this sound buffer.
Return Value:
No return value.
Parameter | Description |
orientation
| The D3dVector that will contain the current orientation of the sound projection cone. The vector information represents the center of the sound cone.
|
Remarks:
This method has no effect unless the cone angle and cone volume factor have also been set. The default value is (0,0,1).
public void getConeOutsideVolume(int[] coneOutsideVolume);
Retrieves the current cone outside volume for this sound buffer.
Return Value:
No return value.
Parameter | Description |
coneOutsideVolume
| The current cone outside volume for this buffer.
|
Remarks:
Volume levels are represented by attenuation. Allowable values are between 0 (no attenuation) and -10,000 (silence). Amplification is not currently supported by DirectSound.
public void getMaxDistance(float[] maxDistance);
Retrieves the current maximum distance for this sound buffer.
Return Value:
No return value.
Parameter | Description |
maxDistance
| The current maximum distance setting.
|
Remarks:
The maximum distance value is infinite by default.
public void getMinDistance(float[] minDistance);
Retrieves the current minimum distance for this sound buffer.
Return Value:
No return value.
Parameter | Description |
minDistance
| The current minimum distance setting.
|
Remarks:
The minimum distance value is 1.0 (corresponding to 1.0 meter at the default distance factor of 1.0 m per unit) by default.
public void getMode(int[] mode);
Retrieves the current operation mode for 3D sound processing.
Return Value:
No return value.
public void getPosition(D3dVector position);
Retrieves the sound buffer's current position, in distance units. Distance units are meters by default, but the units can be changed by using the setDistanceFactor method.
Return Value:
No return value.
Parameter | Description |
position
| The D3dVector that will contain the current position of the sound buffer.
|
public void getVelocity(D3dVector velocity);
Retrieves the current velocity for this sound buffer.
Return Value:
No return value.
Parameter | Description |
velocity
| The D3dVector that will contain the sound buffer's current velocity.
|
Remarks:
Velocity is used for Doppler effects only. It does not actually move the buffer.
public void setAllParameters(DS3dBuffer buffer, int applyFlag);
Sets all 3D sound buffer parameters from a given DS3dBuffer that describes all aspects of the sound buffer at a moment in time.
Return Value:
No return value.
Parameter | Description |
buffer
| The DS3dBuffer containing the information that describes the 3D characteristics of the sound buffer.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
public void setConeAngles(int inCone, int outCone, int applyFlag);
Sets the inside and outside angles of the sound projection cone for this sound buffer.
Return Value:
No return value.
Parameter | Description |
inCone
| Inside angle of the sound projection cone.
|
outCone
| Outside angle of the sound projection cone.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
Each angle must be in the range of 0 degrees (no cone) to 360 degrees (the full sphere). The default value is 360. For additional information see, Sound Projection Cones.
public void setConeOrientation(float x, float y, float z, int applyFlag);
Sets the orientation of the sound projection cone for this sound buffer. This method has no effect unless the cone angle and cone volume factor have also been set.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate of the new sound cone orientation vector.
|
y
| The y coordinate of the new sound cone orientation vector.
|
z
| The z-coordinate of the new sound cone orientation vector.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
The vector information in the orientation parameter of the getConeOrientation method represents the center of the sound cone. The default value is (0,0,1).
public void setConeOutsideVolume(int coneOutsideVolume, int applyFlag);
Sets the current cone outside volume for this sound buffer.
Return Value:
No return value.
Parameter | Description |
coneOutsideVolume
| Cone outside volume for this sound buffer, in hundredths of decibels. Allowable values are between 0 (no attenuation) and -10,000 (silence).
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
Volume levels are represented by attenuation. Amplification is not currently supported by DirectSound.
public void setMaxDistance(float maxDistance, int applyFlag);
Sets the current maximum distance value.
Return Value:
No return value.
Parameter | Description |
maxDistance
| New maximum distance value.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
The maximum distance value is infinite by default.
public void setMinDistance(float minDistance, int applyFlag);
Sets the current minimum distance value.
Return Value:
No return value.
Parameter | Description |
minDistance
| New minimum distance value.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
The minimum distance value is 1.0 (corresponding to 1.0 meter at the default distance factor of 1.0 m per unit) by default.
public void setMode(int mode, int applyFlag);
Sets the operation mode for 3D sound processing.
Return Value:
No return value.
Parameter | Description |
mode
| Flag specifying the 3D sound processing mode to be set.
- DS3DMODE_DISABLE
- Processing of 3D sound is disabled. The sound seems to originate from the center of the listener's head.
- DS3DMODE_HEADRELATIVE
- Sound parameters (position, velocity, and orientation) are relative to the listener's parameters. In this mode, the absolute parameters of the sound are updated automatically as the listener's parameters change, so that the relative parameters remain constant.
- DS3DMODE_NORMAL
- Normal processing. This is the default mode.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
public void setPosition(float x, float y, float z, int applyFlag);
Sets the sound buffer's current position, in distance units. Distance units are meters by default, but the units can be changed by using the setDistanceFactor method.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate of the new position vector.
|
y
| The y coordinate of the new position vector.
|
z
| The z-coordinate of the new position vector.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
public void setVelocity(float x, float y, float z, int applyFlag);
Sets the sound buffer's current velocity.
Return Value:
No return value.
Parameter | Description |
x
| The x coordinate of the new velocity vector.
|
y
| The y coordinate of the new velocity vector.
|
z
| The z-coordinate of the new velocity vector.
|
applyFlag
| Value indicating when the setting should be applied. This value must be one of the following:
- DS3D_DEFERRED
- DS3D_IMMEDIATE
|
Remarks:
Velocity is used for Doppler effects only. It does not actually move the buffer.