|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.jme3.scene.Spatial
com.jme3.scene.Node
com.jme3.audio.AudioNode
public class AudioNode
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)
|
クラス java.lang.Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
---|
public AudioNode()
AudioNode
without any audio data set.
public AudioNode(AudioRenderer audioRenderer)
AudioNode
without any audio data set.
audioRenderer
- The audio renderer to use for playing. Cannot be null.public AudioNode(AudioRenderer audioRenderer, AudioData audioData, AudioKey key)
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 AudioDatapublic AudioNode(AudioData audioData, AudioKey key)
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 AudioDatapublic AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, java.lang.String name, boolean stream, boolean streamCache)
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 filename
- The filename of the audio filestream
- 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.public AudioNode(AssetManager assetManager, java.lang.String name, boolean stream, boolean streamCache)
AudioNode
with the given audio file.
assetManager
- The asset manager to use to load the audio filename
- The filename of the audio filestream
- 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.public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, java.lang.String name, boolean stream)
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 filename
- The filename of the audio filestream
- If true, the audio will be streamed gradually from disk,
otherwise, it will be buffered.public AudioNode(AssetManager assetManager, java.lang.String name, boolean stream)
AudioNode
with the given audio file.
assetManager
- The asset manager to use to load the audio filename
- The filename of the audio filestream
- If true, the audio will be streamed gradually from disk,
otherwise, it will be buffered.public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, java.lang.String name)
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 filename
- The filename of the audio filepublic AudioNode(AssetManager assetManager, java.lang.String name)
AudioNode
with the given audio file.
assetManager
- The asset manager to use to load the audio filename
- The filename of the audio fileメソッドの詳細 |
---|
public void play()
public void playInstance()
AudioNode
multiple times. Note
that changes to the parameters of this AudioNode will not effect the
instances already playing.
public void stop()
play()
.
public final void setChannel(int channel)
public int getChannel()
public Filter getDryFilter()
setDryFilter(com.jme3.audio.Filter)
public void setDryFilter(Filter dryFilter)
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.public void setAudioData(AudioData audioData, AudioKey key)
AudioData
.
audioData
- The audio data contains the audio track to play.key
- The audio key that was used to load the AudioDatapublic AudioData getAudioData()
AudioData
set previously with
setAudioData(com.jme3.audio.AudioData, com.jme3.audio.AudioKey)
or any of the constructors that initialize the audio data.public AudioNode.Status getStatus()
AudioNode.Status
of the audio node.
The status will be changed when either the play()
or stop()
methods are called.public final void setStatus(AudioNode.Status status)
public boolean isLooping()
setLooping(boolean)
public void setLooping(boolean loop)
loop
- True if the audio should keep looping after it is done playing.public float getPitch()
setPitch(float)
public void setPitch(float pitch)
pitch
- The pitch to set.
java.lang.IllegalArgumentException
- If pitch is not between 0.5 and 2.0.public float getVolume()
setVolume(float)
public void setVolume(float volume)
volume
- The volume to set.
java.lang.IllegalArgumentException
- If volume is negativepublic float getTimeOffset()
public void setTimeOffset(float timeOffset)
timeOffset
- The time offset
java.lang.IllegalArgumentException
- If timeOffset is negativepublic Vector3f getVelocity()
setVelocity(com.jme3.math.Vector3f)
public void setVelocity(Vector3f velocity)
velocity
- The velocity to set.setPositional(boolean)
public boolean isReverbEnabled()
setReverbEnabled(boolean)
public void setReverbEnabled(boolean reverbEnabled)
AudioRenderer.setEnvironment(com.jme3.audio.Environment)
will apply a reverb effect to the audio playing from this audio node.
reverbEnabled
- True to enable reverb.public Filter getReverbFilter()
setReverbFilter(com.jme3.audio.Filter)
public void setReverbFilter(Filter reverbFilter)
reverbFilter
- The reverb filter to set.setDryFilter(com.jme3.audio.Filter)
public float getMaxDistance()
setMaxDistance(float)
public void setMaxDistance(float maxDistance)
maxDistance
- The maximum playing distance.
java.lang.IllegalArgumentException
- If maxDistance is negativepublic float getRefDistance()
setRefDistance(float)
public void setRefDistance(float refDistance)
refDistance
- The reference playing distance.
java.lang.IllegalArgumentException
- If refDistance is negativepublic boolean isDirectional()
setDirectional(boolean)
public void setDirectional(boolean directional)
setDirection(com.jme3.math.Vector3f)
to set the audio node's direction.
directional
- If the audio node is directionalpublic Vector3f getDirection()
setDirection(com.jme3.math.Vector3f)
public void setDirection(Vector3f direction)
direction
- setDirectional(boolean)
public float getInnerAngle()
setInnerAngle(float)
public void setInnerAngle(float innerAngle)
innerAngle
- The cone inner angle.public float getOuterAngle()
setOuterAngle(float)
public void setOuterAngle(float outerAngle)
outerAngle
- The cone outer angle.public boolean isPositional()
setPositional(boolean)
public void setPositional(boolean positional)
positional
- True if the audio node should be positional, otherwise
false if it should be headspace.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()
public AudioNode clone()
Spatial
内の clone
Mesh.cloneForAnim()
public void write(JmeExporter ex) throws java.io.IOException
Savable
内の write
Node
内の write
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
Savable
内の read
Node
内の read
java.io.IOException
public java.lang.String toString()
Spatial
の記述:
Spatial
内の toString
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |