com.jme3.audio
クラス AudioNode

java.lang.Object
  上位を拡張 com.jme3.scene.Spatial
      上位を拡張 com.jme3.scene.Node
          上位を拡張 com.jme3.audio.AudioNode
すべての実装されたインタフェース:
Asset, Collidable, Savable, java.lang.Cloneable

public class AudioNode
extends Node

An AudioNode is used in jME3 for playing audio files.
First, an AudioNode is loaded from file, and then assigned to an audio node for playback. Once the audio node is attached to the scene, its location will influence the position it is playing from relative to the Listener.
An audio node can also play in "headspace", meaning its location or velocity does not influence how it is played. The "positional" property of an AudioNode can be set via setPositional(boolean).


入れ子のクラスの概要
static class AudioNode.Status
          Status indicates the current status of the audio node.
 
クラス com.jme3.scene.Spatial から継承された入れ子のクラス/インタフェース
Spatial.CullHint
 
フィールドの概要
 
クラス com.jme3.scene.Spatial から継承されたフィールド
queueDistance
 
コンストラクタの概要
AudioNode()
          Creates a new AudioNode without any audio data set.
AudioNode(AssetManager assetManager, java.lang.String name)
          Creates a new AudioNode with the given audio file.
AudioNode(AssetManager assetManager, java.lang.String name, boolean stream)
          Creates a new AudioNode with the given audio file.
AudioNode(AssetManager assetManager, java.lang.String name, boolean stream, boolean streamCache)
          Creates a new AudioNode with the given audio file.
AudioNode(AudioData audioData, AudioKey key)
          Creates a new AudioNode with the given data and key.
AudioNode(AudioRenderer audioRenderer)
          推奨されていません。 AudioRenderer parameter is ignored.
AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, java.lang.String name)
          推奨されていません。 AudioRenderer parameter is ignored.
AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, java.lang.String name, boolean stream)
          推奨されていません。 AudioRenderer parameter is ignored.
AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, java.lang.String name, boolean stream, boolean streamCache)
          推奨されていません。 AudioRenderer parameter is ignored.
AudioNode(AudioRenderer audioRenderer, AudioData audioData, AudioKey key)
          推奨されていません。 AudioRenderer parameter is ignored.
 
メソッドの概要
 AudioNode clone()
           
 AudioData getAudioData()
           
 int getChannel()
          Do not use.
 Vector3f getDirection()
           
 Filter getDryFilter()
           
 float getInnerAngle()
           
 float getMaxDistance()
           
 float getOuterAngle()
           
 float getPitch()
           
 float getRefDistance()
           
 Filter getReverbFilter()
           
 AudioNode.Status getStatus()
           
 float getTimeOffset()
           
 Vector3f getVelocity()
           
 float getVolume()
           
 boolean isDirectional()
           
 boolean isLooping()
           
 boolean isPositional()
           
 boolean isReverbEnabled()
           
 void play()
          Start playing the audio.
 void playInstance()
          Start playing an instance of this audio.
 void read(JmeImporter im)
           
 void setAudioData(AudioData audioData, AudioKey key)
          Set the audio data to use for the audio.
 void setChannel(int channel)
          Do not use.
 void setDirection(Vector3f direction)
          Set the direction of this audio node.
 void setDirectional(boolean directional)
          Set the audio node to be directional.
 void setDryFilter(Filter dryFilter)
          Set the dry filter to use for this audio node.
 void setInnerAngle(float innerAngle)
          Set the directional audio node cone inner angle.
 void setLooping(boolean loop)
          Set the looping mode for the audio node.
 void setMaxDistance(float maxDistance)
          Set the maximum distance for the attenuation of the audio node.
 void setOuterAngle(float outerAngle)
          Set the directional audio node cone outer angle.
 void setPitch(float pitch)
          Set the pitch of the audio, also the speed of playback.
 void setPositional(boolean positional)
          Set the audio node as positional.
 void setRefDistance(float refDistance)
          Set the reference playing distance for the audio node.
 void setReverbEnabled(boolean reverbEnabled)
          Set to true to enable reverberation effects for this audio node.
 void setReverbFilter(Filter reverbFilter)
          Set the reverb filter for this audio node.
 void setStatus(AudioNode.Status status)
          Do not use.
 void setTimeOffset(float timeOffset)
          Set the time offset in seconds when the sound will start playing.
 void setVelocity(Vector3f velocity)
          Set the velocity of the audio node.
 void setVolume(float volume)
          Set the volume of this audio node.
 void stop()
          Stop playing the audio that was started with play().
 java.lang.String toString()
          Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)
 void updateGeometricState()
          updateGeometricState updates the lightlist, computes the world transforms, and computes the world bounds for this Spatial.
 void write(JmeExporter ex)
           
 
クラス com.jme3.scene.Node から継承されたメソッド
attachChild, attachChildAt, clone, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, setLodLevel, setMaterial, setModelBound, swapChildren, updateLogicalState, updateModelBound
 
クラス com.jme3.scene.Spatial から継承されたメソッド
addControl, addLight, breadthFirstTraversal, center, checkCulling, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, localToWorld, lookAt, matches, move, move, removeControl, removeControl, removeFromParent, removeLight, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setShadowMode, setUserData, worldToLocal
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

AudioNode

public AudioNode()
Creates a new AudioNode without any audio data set.


AudioNode

public AudioNode(AudioRenderer audioRenderer)
推奨されていません。 AudioRenderer parameter is ignored.

Creates a new AudioNode without any audio data set.

パラメータ:
audioRenderer - The audio renderer to use for playing. Cannot be null.

AudioNode

public AudioNode(AudioRenderer audioRenderer,
                 AudioData audioData,
                 AudioKey key)
推奨されていません。 AudioRenderer parameter is ignored.

Creates a new AudioNode with the given data and key.

パラメータ:
audioRenderer - The audio renderer to use for playing. Cannot be null.
audioData - The audio data contains the audio track to play.
key - The audio key that was used to load the AudioData

AudioNode

public AudioNode(AudioData audioData,
                 AudioKey key)
Creates a new AudioNode with the given data and key.

パラメータ:
audioData - The audio data contains the audio track to play.
key - The audio key that was used to load the AudioData

AudioNode

public AudioNode(AudioRenderer audioRenderer,
                 AssetManager assetManager,
                 java.lang.String name,
                 boolean stream,
                 boolean streamCache)
推奨されていません。 AudioRenderer parameter is ignored.

Creates a new AudioNode with the given audio file.

パラメータ:
audioRenderer - The audio renderer to use for playing. Cannot be null.
assetManager - The asset manager to use to load the audio file
name - The filename of the audio file
stream - If true, the audio will be streamed gradually from disk, otherwise, it will be buffered.
streamCache - If stream is also true, then this specifies if the stream cache is used. When enabled, the audio stream will be read entirely but not decoded, allowing features such as seeking, looping and determining duration.

AudioNode

public AudioNode(AssetManager assetManager,
                 java.lang.String name,
                 boolean stream,
                 boolean streamCache)
Creates a new AudioNode with the given audio file.

パラメータ:
assetManager - The asset manager to use to load the audio file
name - The filename of the audio file
stream - If true, the audio will be streamed gradually from disk, otherwise, it will be buffered.
streamCache - If stream is also true, then this specifies if the stream cache is used. When enabled, the audio stream will be read entirely but not decoded, allowing features such as seeking, looping and determining duration.

AudioNode

public AudioNode(AudioRenderer audioRenderer,
                 AssetManager assetManager,
                 java.lang.String name,
                 boolean stream)
推奨されていません。 AudioRenderer parameter is ignored.

Creates a new AudioNode with the given audio file.

パラメータ:
audioRenderer - The audio renderer to use for playing. Cannot be null.
assetManager - The asset manager to use to load the audio file
name - The filename of the audio file
stream - If true, the audio will be streamed gradually from disk, otherwise, it will be buffered.

AudioNode

public AudioNode(AssetManager assetManager,
                 java.lang.String name,
                 boolean stream)
Creates a new AudioNode with the given audio file.

パラメータ:
assetManager - The asset manager to use to load the audio file
name - The filename of the audio file
stream - If true, the audio will be streamed gradually from disk, otherwise, it will be buffered.

AudioNode

public AudioNode(AudioRenderer audioRenderer,
                 AssetManager assetManager,
                 java.lang.String name)
推奨されていません。 AudioRenderer parameter is ignored.

Creates a new AudioNode with the given audio file.

パラメータ:
audioRenderer - The audio renderer to use for playing. Cannot be null.
assetManager - The asset manager to use to load the audio file
name - The filename of the audio file

AudioNode

public AudioNode(AssetManager assetManager,
                 java.lang.String name)
Creates a new AudioNode with the given audio file.

パラメータ:
assetManager - The asset manager to use to load the audio file
name - The filename of the audio file
メソッドの詳細

play

public void play()
Start playing the audio.


playInstance

public void playInstance()
Start playing an instance of this audio. This method can be used to play the same AudioNode multiple times. Note that changes to the parameters of this AudioNode will not effect the instances already playing.


stop

public void stop()
Stop playing the audio that was started with play().


setChannel

public final void setChannel(int channel)
Do not use.


getChannel

public int getChannel()
Do not use.


getDryFilter

public Filter getDryFilter()
戻り値:
The {#link Filter dry filter} that is set.
関連項目:
setDryFilter(com.jme3.audio.Filter)

setDryFilter

public void setDryFilter(Filter dryFilter)
Set the dry filter to use for this audio node. When reverb is used, the dry filter will only influence the "dry" portion of the audio, e.g. not the reverberated parts of the AudioNode playing. See the relevent documentation for the Filter to determine the effect.

パラメータ:
dryFilter - The filter to set, or null to disable dry filter.

setAudioData

public void setAudioData(AudioData audioData,
                         AudioKey key)
Set the audio data to use for the audio. Note that this method can only be called once, if for example the audio node was initialized without an AudioData.

パラメータ:
audioData - The audio data contains the audio track to play.
key - The audio key that was used to load the AudioData

getAudioData

public AudioData getAudioData()
戻り値:
The AudioData set previously with setAudioData(com.jme3.audio.AudioData, com.jme3.audio.AudioKey) or any of the constructors that initialize the audio data.

getStatus

public AudioNode.Status getStatus()
戻り値:
The AudioNode.Status of the audio node. The status will be changed when either the play() or stop() methods are called.

setStatus

public final void setStatus(AudioNode.Status status)
Do not use.


isLooping

public boolean isLooping()
戻り値:
True if the audio will keep looping after it is done playing, otherwise, false.
関連項目:
setLooping(boolean)

setLooping

public void setLooping(boolean loop)
Set the looping mode for the audio node. The default is false.

パラメータ:
loop - True if the audio should keep looping after it is done playing.

getPitch

public float getPitch()
戻り値:
The pitch of the audio, also the speed of playback.
関連項目:
setPitch(float)

setPitch

public void setPitch(float pitch)
Set the pitch of the audio, also the speed of playback. The value must be between 0.5 and 2.0.

パラメータ:
pitch - The pitch to set.
例外:
java.lang.IllegalArgumentException - If pitch is not between 0.5 and 2.0.

getVolume

public float getVolume()
戻り値:
The volume of this audio node.
関連項目:
setVolume(float)

setVolume

public void setVolume(float volume)
Set the volume of this audio node. The volume is specified as gain. 1.0 is the default.

パラメータ:
volume - The volume to set.
例外:
java.lang.IllegalArgumentException - If volume is negative

getTimeOffset

public float getTimeOffset()
戻り値:
The time offset in seconds when the sound will start playing.

setTimeOffset

public void setTimeOffset(float timeOffset)
Set the time offset in seconds when the sound will start playing.

パラメータ:
timeOffset - The time offset
例外:
java.lang.IllegalArgumentException - If timeOffset is negative

getVelocity

public Vector3f getVelocity()
戻り値:
The velocity of the audio node.
関連項目:
setVelocity(com.jme3.math.Vector3f)

setVelocity

public void setVelocity(Vector3f velocity)
Set the velocity of the audio node. The velocity is expected to be in meters. Does nothing if the audio node is not positional.

パラメータ:
velocity - The velocity to set.
関連項目:
setPositional(boolean)

isReverbEnabled

public boolean isReverbEnabled()
戻り値:
True if reverb is enabled, otherwise false.
関連項目:
setReverbEnabled(boolean)

setReverbEnabled

public void setReverbEnabled(boolean reverbEnabled)
Set to true to enable reverberation effects for this audio node. Does nothing if the audio node is not positional.
When enabled, the audio environment set with AudioRenderer.setEnvironment(com.jme3.audio.Environment) will apply a reverb effect to the audio playing from this audio node.

パラメータ:
reverbEnabled - True to enable reverb.

getReverbFilter

public Filter getReverbFilter()
戻り値:
Filter for the reverberations of this audio node.
関連項目:
setReverbFilter(com.jme3.audio.Filter)

setReverbFilter

public void setReverbFilter(Filter reverbFilter)
Set the reverb filter for this audio node.
The reverb filter will influence the reverberations of the audio node playing. This only has an effect if reverb is enabled.

パラメータ:
reverbFilter - The reverb filter to set.
関連項目:
setDryFilter(com.jme3.audio.Filter)

getMaxDistance

public float getMaxDistance()
戻り値:
Max distance for this audio node.
関連項目:
setMaxDistance(float)

setMaxDistance

public void setMaxDistance(float maxDistance)
Set the maximum distance for the attenuation of the audio node. Does nothing if the audio node is not positional.
The maximum distance is the distance beyond which the audio node will no longer be attenuated. Normal attenuation is logarithmic from refDistance (it reduces by half when the distance doubles). Max distance sets where this fall-off stops and the sound will never get any quieter than at that distance. If you want a sound to fall-off very quickly then set ref distance very short and leave this distance very long.

パラメータ:
maxDistance - The maximum playing distance.
例外:
java.lang.IllegalArgumentException - If maxDistance is negative

getRefDistance

public float getRefDistance()
戻り値:
The reference playing distance for the audio node.
関連項目:
setRefDistance(float)

setRefDistance

public void setRefDistance(float refDistance)
Set the reference playing distance for the audio node. Does nothing if the audio node is not positional.
The reference playing distance is the distance at which the audio node will be exactly half of its volume.

パラメータ:
refDistance - The reference playing distance.
例外:
java.lang.IllegalArgumentException - If refDistance is negative

isDirectional

public boolean isDirectional()
戻り値:
True if the audio node is directional
関連項目:
setDirectional(boolean)

setDirectional

public void setDirectional(boolean directional)
Set the audio node to be directional. Does nothing if the audio node is not positional.
After setting directional, you should call setDirection(com.jme3.math.Vector3f) to set the audio node's direction.

パラメータ:
directional - If the audio node is directional

getDirection

public Vector3f getDirection()
戻り値:
The direction of this audio node.
関連項目:
setDirection(com.jme3.math.Vector3f)

setDirection

public void setDirection(Vector3f direction)
Set the direction of this audio node. Does nothing if the audio node is not directional.

パラメータ:
direction -
関連項目:
setDirectional(boolean)

getInnerAngle

public float getInnerAngle()
戻り値:
The directional audio node, cone inner angle.
関連項目:
setInnerAngle(float)

setInnerAngle

public void setInnerAngle(float innerAngle)
Set the directional audio node cone inner angle. Does nothing if the audio node is not directional.

パラメータ:
innerAngle - The cone inner angle.

getOuterAngle

public float getOuterAngle()
戻り値:
The directional audio node, cone outer angle.
関連項目:
setOuterAngle(float)

setOuterAngle

public void setOuterAngle(float outerAngle)
Set the directional audio node cone outer angle. Does nothing if the audio node is not directional.

パラメータ:
outerAngle - The cone outer angle.

isPositional

public boolean isPositional()
戻り値:
True if the audio node is positional.
関連項目:
setPositional(boolean)

setPositional

public void setPositional(boolean positional)
Set the audio node as positional. The position, velocity, and distance parameters effect positional audio nodes. Set to false if the audio node should play in "headspace".

パラメータ:
positional - True if the audio node should be positional, otherwise false if it should be headspace.

updateGeometricState

public void updateGeometricState()
クラス Spatial の記述:
updateGeometricState updates the lightlist, computes the world transforms, and computes the world bounds for this Spatial. Calling this when the Spatial is attached to a node will cause undefined results. User code should only call this method on Spatials having no parent.

オーバーライド:
クラス Node 内の updateGeometricState
関連項目:
Spatial.getWorldLightList(), Spatial.getWorldTransform(), Spatial.getWorldBound()

clone

public AudioNode clone()
オーバーライド:
クラス Spatial 内の clone
戻り値:
A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated. All controls will be cloned using the Control.cloneForSpatial method on the clone.
関連項目:
Mesh.cloneForAnim()

write

public void write(JmeExporter ex)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス Node 内の write
例外:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス Node 内の read
例外:
java.io.IOException

toString

public java.lang.String toString()
クラス Spatial の記述:
Returns the Spatial's name followed by the class of the spatial
Example: "MyNode (com.jme3.scene.Spatial)

オーバーライド:
クラス Spatial 内の toString
戻り値:
Spatial's name followed by the class of the Spatial