Java Doc for JSPositionalSample.java in  » 6.0-JDK-Modules » java-3d » com » sun » j3d » audioengines » javasound » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.sun.j3d.audioengines.javasound 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.j3d.audioengines.Sample
      com.sun.j3d.audioengines.javasound.JSSample
         com.sun.j3d.audioengines.javasound.JSPositionalSample

All known Subclasses:   com.sun.j3d.audioengines.javasound.JSDirectionalSample,
JSPositionalSample
class JSPositionalSample extends JSSample (Code)
The PostionalSample Class defines the data and methods associated with a PointSound sample played thru the AudioDevice.


Field Summary
static  intAWAY
    
static  intMAX_DISTANCES
    
static  intNO_CHANGE
    
static  intTOWARDS
    
 booleanaverageDistances
    
 Point3f[]centerEars
    
 intcurrentIndex
    
 longdeltaTime
    
final protected static  booleandopplerFlag
    
 booleanfilterFlag
    
 floatfilterFreq
    
 intfirstIndex
    
 doubleheadPositionChange
    
 doublelastActualDopplerRateRatio
    
 intlastIndex
    
 doublelastRequestedDopplerRateRatio
    
 intleftDelay
    
 floatleftGain
    
static  doublemaxRatio
    
 intnumDistances
    
 Point3f[]positions
    
 intreverbIndex
     A third sample for control of reverb of the stream/clip is openned and maintained for all directional/positional sounds. For now, even if no aural attributes (using reverb) are active, a reverb channel is always started with the other two.
 intrightDelay
    
 floatrightGain
    
 intsecondIndex
     For positional and directional sounds, TWO Hae streams or clips are allocated, one each for the left and right channels, played at a different (delayed) time and with a different gain value.
 doublesourcePositionChange
    
 Vector3fsourceToCenterEar
    
 Vector3fsourceToLeftEar
    
 Vector3fsourceToRightEar
    
 long[]times
    
 Vector3fxformHeadZAxis
    
 Point3fxformLeftEar
    
 Point3fxformRightEar
    

Constructor Summary
public  JSPositionalSample()
    

Method Summary
 floatcalculateAngularGain()
    
 floatcalculateDistanceAttenuation(float distance)
     CalculateDistanceAttenuation Simply calls generic (for PointSound) 'findFactor()' with a single set of attenuation distance and gain scale factor arrays.
 floatcalculateDoppler(AuralParameters attribs)
     Set Doppler effect Rate Calculate the rate of change in for the head and sound between the two time stamps (last two times position or VirtualWorld transform was updated).
 voidcalculateFilter(float distance, AuralParameters attribs)
    
 booleancalculateNewEar(int dirtyFlags, View view, Point3f xformCenterEar)
    
public  voidclear()
     Clears the fields associated with sample data for this sound, and frees any device specific data associated with this sample.
 floatfindFactor(double distance, double[] distanceArray, float[] factorArray)
    
 booleangetFilterFlag()
    
 floatgetFilterFreq()
    
 voidincrementIndices()
    
 voidpanSample(AuralParameters attribs)
    
public  voidrender(int dirtyFlags, View view, AuralParameters attribs)
     Render this sample Calculate the audiodevice parameters necessary to spatially play this sound.
 voidreset()
    
 voidsetXformedPosition()
    
 voidupdateEar(int dirtyFlags, View view)
    

Field Detail
AWAY
static int AWAY(Code)



MAX_DISTANCES
static int MAX_DISTANCES(Code)



NO_CHANGE
static int NO_CHANGE(Code)



TOWARDS
static int TOWARDS(Code)



averageDistances
boolean averageDistances(Code)



centerEars
Point3f[] centerEars(Code)



currentIndex
int currentIndex(Code)



deltaTime
long deltaTime(Code)



dopplerFlag
final protected static boolean dopplerFlag(Code)



filterFlag
boolean filterFlag(Code)



filterFreq
float filterFreq(Code)



firstIndex
int firstIndex(Code)



headPositionChange
double headPositionChange(Code)



lastActualDopplerRateRatio
double lastActualDopplerRateRatio(Code)



lastIndex
int lastIndex(Code)



lastRequestedDopplerRateRatio
double lastRequestedDopplerRateRatio(Code)



leftDelay
int leftDelay(Code)



leftGain
float leftGain(Code)



maxRatio
static double maxRatio(Code)



numDistances
int numDistances(Code)



positions
Point3f[] positions(Code)



reverbIndex
int reverbIndex(Code)
A third sample for control of reverb of the stream/clip is openned and maintained for all directional/positional sounds. For now, even if no aural attributes (using reverb) are active, a reverb channel is always started with the other two. A sound could be started without reverb and then reverb added later, but since there is no way to offset properly into all sounds (considering non-cached and nconsistent rate-changes during playing) this third sound is always allocated and started.



rightDelay
int rightDelay(Code)



rightGain
float rightGain(Code)



secondIndex
int secondIndex(Code)
For positional and directional sounds, TWO Hae streams or clips are allocated, one each for the left and right channels, played at a different (delayed) time and with a different gain value.



sourcePositionChange
double sourcePositionChange(Code)



sourceToCenterEar
Vector3f sourceToCenterEar(Code)
Save vectors from source source position to transformed ear parameters



sourceToLeftEar
Vector3f sourceToLeftEar(Code)



sourceToRightEar
Vector3f sourceToRightEar(Code)



times
long[] times(Code)



xformHeadZAxis
Vector3f xformHeadZAxis(Code)



xformLeftEar
Point3f xformLeftEar(Code)
Save ear positions transformed into VirtualWorld coords from Head coords These default positions are used when the real values cannot queried



xformRightEar
Point3f xformRightEar(Code)




Constructor Detail
JSPositionalSample
public JSPositionalSample()(Code)




Method Detail
calculateAngularGain
float calculateAngularGain()(Code)



calculateDistanceAttenuation
float calculateDistanceAttenuation(float distance)(Code)
CalculateDistanceAttenuation Simply calls generic (for PointSound) 'findFactor()' with a single set of attenuation distance and gain scale factor arrays.



calculateDoppler
float calculateDoppler(AuralParameters attribs)(Code)
Set Doppler effect Rate Calculate the rate of change in for the head and sound between the two time stamps (last two times position or VirtualWorld transform was updated). First determine if the head and sound source are moving towards each other (distance between them is decreasing), moving away from each other (distance between them is increasing), or no change (distance is the same, not moving or moving the same speed/direction). The following equation is used for determining the change in frequency - If there has been a change in the distance between the head and sound: f' = f * frequencyScaleFactor * velocityRatio For no change in the distance bewteen head and sound, velocityRatio is 1: f' = f For head and sound moving towards each other, velocityRatio (> 1.0) is: | speedOfSound*rollOff + velocityOfHead*velocityScaleFactor | | ------------------------------------------------------------- | | speedOfSound*rollOff - velocityOfSource*velocityScaleFactor | For head and sound moving away from each other, velocityRatio (< 1.0) is: | speedOfSound*rollOff - velocityOfHead*velocityScaleFactor | | ------------------------------------------------------------- | | speedOfSound*rollOff + velocityOfSource*velocityScaleFactor | where frequencyScaleFactor, rollOff, velocityScaleFactor all come from the active AuralAttributes parameters. The following special cases must be test for AuralAttribute parameters: rolloff Value MUST be > zero for any sound to be heard! If value is zero, all sounds affected by AuralAttribute region are silent. velocityScaleFactor Value MUST be > zero for any sound to be heard! If value is zero, all sounds affected by AuralAttribute region are paused. frequencyScaleFactor Value of zero disables Doppler calculations: Sfreq' = Sfreq * frequencyScaleFactor This rate is passed to device drive as a change to playback sample rate, in this case the frequency need not be known. Return value of zero denotes no change Return value of -1 denotes ERROR



calculateFilter
void calculateFilter(float distance, AuralParameters attribs)(Code)



calculateNewEar
boolean calculateNewEar(int dirtyFlags, View view, Point3f xformCenterEar)(Code)



clear
public void clear()(Code)
Clears the fields associated with sample data for this sound, and frees any device specific data associated with this sample.



findFactor
float findFactor(double distance, double[] distanceArray, float[] factorArray)(Code)



getFilterFlag
boolean getFilterFlag()(Code)



getFilterFreq
float getFilterFreq()(Code)



incrementIndices
void incrementIndices()(Code)



panSample
void panSample(AuralParameters attribs)(Code)



render
public void render(int dirtyFlags, View view, AuralParameters attribs)(Code)
Render this sample Calculate the audiodevice parameters necessary to spatially play this sound.



reset
void reset()(Code)
Reset time and count based fields associated with sample data for this sound



setXformedPosition
void setXformedPosition()(Code)



updateEar
void updateEar(int dirtyFlags, View view)(Code)



Fields inherited from com.sun.j3d.audioengines.javasound.JSSample
final static int BUFFERED_AUDIO_DATA(Code)(Java Doc)
final static int BUFFERED_MIDI_DATA(Code)(Java Doc)
final static int NULL_SAMPLE(Code)(Java Doc)
final static int STREAMING_AUDIO_DATA(Code)(Java Doc)
final static int STREAMING_MIDI_DATA(Code)(Java Doc)
final static int UNSUPPORTED_DATA_TYPE(Code)(Java Doc)
long attackLength(Code)(Java Doc)
JSChannel channel(Code)(Java Doc)
float currentRateRatio(Code)(Java Doc)
long dataOffset(Code)(Java Doc)
int dataType(Code)(Java Doc)
long loopLength(Code)(Java Doc)
long loopStartOffset(Code)(Java Doc)
long positionDeactivated(Code)(Java Doc)
boolean rampRateFlag(Code)(Java Doc)
float rateRatio(Code)(Java Doc)
long releaseLength(Code)(Java Doc)
long sampleLength(Code)(Java Doc)
float targetRateRatio(Code)(Java Doc)
long timeDeactivated(Code)(Java Doc)

Methods inherited from com.sun.j3d.audioengines.javasound.JSSample
public void clear()(Code)(Java Doc)
float getCurrentRateRatio()(Code)(Java Doc)
int getDataType()(Code)(Java Doc)
boolean getFilterFlag()(Code)(Java Doc)
float getFilterFreq()(Code)(Java Doc)
boolean getRampRateFlag()(Code)(Java Doc)
float getTargetRateRatio()(Code)(Java Doc)
boolean load(MediaContainer soundData)(Code)(Java Doc)
public void render(int dirtyFlags, View view, AuralParameters attribs)(Code)(Java Doc)
void reset()(Code)(Java Doc)
void setCurrentRateRatio(float ratio)(Code)(Java Doc)
void setDataType(int type)(Code)(Java Doc)
void setRampRateFlag(boolean flag)(Code)(Java Doc)
void setTargetRateRatio(float ratio)(Code)(Java Doc)

Fields inherited from com.sun.j3d.audioengines.Sample
final public static int DURATION_UNKNOWN(Code)(Java Doc)
final public static int LOW_PASS(Code)(Java Doc)
final public static int NO_FILTERING(Code)(Java Doc)
final public static int NULL_SAMPLE(Code)(Java Doc)
protected double[] angularDistance(Code)(Java Doc)
protected float[] angularFilterCutoff(Code)(Java Doc)
protected int angularFilterType(Code)(Java Doc)
protected float[] angularGain(Code)(Java Doc)
protected double[] attenuationDistance(Code)(Java Doc)
protected float[] attenuationGain(Code)(Java Doc)
protected double[] backAttenuationDistance(Code)(Java Doc)
protected float[] backAttenuationGain(Code)(Java Doc)
final protected static boolean debugFlag(Code)(Java Doc)
protected Vector3f direction(Code)(Java Doc)
protected int dirtyFlags(Code)(Java Doc)
protected long duration(Code)(Java Doc)
protected float gain(Code)(Java Doc)
final protected static boolean internalErrors(Code)(Java Doc)
protected int loopCount(Code)(Java Doc)
protected boolean mute(Code)(Java Doc)
protected int numberOfChannels(Code)(Java Doc)
protected float obstructionFilterCutoff(Code)(Java Doc)
protected int obstructionFilterType(Code)(Java Doc)
protected float obstructionGain(Code)(Java Doc)
protected float occlusionFilterCutoff(Code)(Java Doc)
protected int occlusionFilterType(Code)(Java Doc)
protected float occlusionGain(Code)(Java Doc)
protected Point3f position(Code)(Java Doc)
protected float rateScaleFactor(Code)(Java Doc)
protected MediaContainer soundData(Code)(Java Doc)
protected int soundType(Code)(Java Doc)
protected boolean vwXfrmFlag(Code)(Java Doc)
protected Transform3D vworldXfrm(Code)(Java Doc)

Methods inherited from com.sun.j3d.audioengines.Sample
public void clear()(Code)(Java Doc)
protected void debugPrint(String message)(Code)(Java Doc)
protected void debugPrintln(String message)(Code)(Java Doc)
public int getDirtyFlags()(Code)(Java Doc)
public long getDuration()(Code)(Java Doc)
public float getGain()(Code)(Java Doc)
public int getLoopCount()(Code)(Java Doc)
public boolean getMuteFlag()(Code)(Java Doc)
public int getNumberOfChannelsUsed()(Code)(Java Doc)
public float getObstructionGain()(Code)(Java Doc)
public float getOcclusionGain()(Code)(Java Doc)
public float getRateScaleFactor()(Code)(Java Doc)
public MediaContainer getSoundData()(Code)(Java Doc)
public int getSoundType()(Code)(Java Doc)
public long getStartTime()(Code)(Java Doc)
public boolean getVWrldXfrmFlag()(Code)(Java Doc)
public void render(int dirtyFlags, View view, AuralParameters attribs)(Code)(Java Doc)
public void setAngularAttenuation(int filterType, double[] angle, float[] attenuationScaleFactor, float[] filterCutoff)(Code)(Java Doc)
public void setDirection(Vector3d direction)(Code)(Java Doc)
public void setDirtyFlags(int flags)(Code)(Java Doc)
public void setDistanceGain(double[] frontDistance, float[] frontAttenuationScaleFactor, double[] backDistance, float[] backAttenuationScaleFactor)(Code)(Java Doc)
public void setGain(float scaleFactor)(Code)(Java Doc)
public void setLoopCount(int count)(Code)(Java Doc)
public void setMuteFlag(boolean flag)(Code)(Java Doc)
public void setObstructionFilter(float cutoffFrequency)(Code)(Java Doc)
public void setObstructionGain(float scaleFactor)(Code)(Java Doc)
public void setOcclusionFilter(float cutoffFrequency)(Code)(Java Doc)
public void setOcclusionGain(float scaleFactor)(Code)(Java Doc)
public void setPosition(Point3d position)(Code)(Java Doc)
public void setRateScaleFactor(float scaleFactor)(Code)(Java Doc)
public void setSoundData(MediaContainer ref)(Code)(Java Doc)
public void setSoundType(int type)(Code)(Java Doc)
public void setVWrldXfrmFlag(boolean flag)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.