public class Sound
extends java.lang.Object
implements jme3utilities.Loadable
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger
message logger for this class
|
| Constructor and Description |
|---|
Sound() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAssetPath(java.lang.String assetPath,
float recordedPitch)
Add an audio asset to this Sound.
|
void |
attachTo(com.jme3.scene.Node parent)
Attach the audio nodes to the specified scene-graph node.
|
void |
detach()
Detach the audio nodes from the scene graph.
|
boolean |
isPositional()
Test whether this Sound is positional.
|
void |
load(com.jme3.asset.AssetManager assetManager)
Load the assets of this Sound without attaching them to any scene.
|
void |
mute()
Configure the audio nodes for silence.
|
void |
setPitchAndVolume(float pitch,
float volume)
Configure the audio nodes for the specified pitch and volume.
|
void |
setPositional(boolean newSetting)
Alter whether this Sound is positional.
|
public static final java.util.logging.Logger logger
public void addAssetPath(java.lang.String assetPath,
float recordedPitch)
assetPath - the asset path, including the extension (not null, not
empty)recordedPitch - the fundamental frequency of the asset (in cycles
per second, >0)public void attachTo(com.jme3.scene.Node parent)
parent - where to attach (not null, modified)public void detach()
public boolean isPositional()
public void mute()
public void setPitchAndVolume(float pitch,
float volume)
pitch - the desired fundamental frequency (in cycles per second,
>0)volume - the desired relative volume (linear scale, ≥0)public void setPositional(boolean newSetting)
newSetting - true→take position/velocity/distance into account
when playing, false→play in "headspace" (default=true)public void load(com.jme3.asset.AssetManager assetManager)
load in interface jme3utilities.LoadableassetManager - for loading assets (not null, alias created)