yage.scene.sound
Authors:
Eric Poggel
License:
LGPL v3
- class
SoundNode
: yage.scene.movable.MovableNode, yage.core.object2.ITemporal;
- A node that emits a sound.
- this();
- Create a SoundNode and optionally set the sound from an already loaded sound or a sound filename.
- SoundNode
clone
(bool children = false);
- Make a duplicate of this node, unattached to any parent Node.
Params:
bool children |
recursively
clone
children (and descendants) and add them as children to the new Node. |
Returns:
The cloned Node.
- Sound
getSound
();
void
setSound
(Sound sound);
- Get / set the Sound ResourceManager that this SoundNode will play.
- void
setSound
(char[] filename);
- Set the Sound used by this Node, using the ResourceManager Manager
to ensure that no Sound is loaded twice.
Equivalent of
setSound
(ResourceManager.sound(filename));
- float
getPitch
();
- Get / set the pitch of the SoundNode.
This has nothing to do with the frequency of the loaded Sound ResourceManager.
Params:
pitch |
Less than 1.0 is deeper, greater than 1.0 is higher.
ditto
Get / set the pitch of the SoundNode.
This has nothing to do with the frequency of the loaded Sound ResourceManager. |
Params:
pitch |
Less than 1.0 is deeper, greater than 1.0 is higher. |
- float
getSoundRadius
();
void
setSoundRadius
(float radius);
- Get / set the radius of the SoundNode. The volume of the sound falls off at a rate of
inverse distance squared. The default radius is 256.
Params:
radius |
The sound will be 1/2 its volume at this distance. |
- float
getVolume
();
void
setVolume
(float volume);
- Get / set the volume (gain) of the SoundNode.
Params:
volume |
1.0 is the default. |
- float
getVolumeAtPosition
(Vec3f position);
- Get the volume of this sound as it would be heard at an arbitrary position.
Params:
Vec3f position |
3D Coordinates |
Returns:
The volume, where n is the volume of a SoundNode with a volume of 1.0 at a distnace of n.
- bool
getLooping
();
void
setLooping
(bool looping = true);
- Get / set whether the playback of the SoundNode loops when playback is finished.
- void
play
();
- Begin / resume playback of the sound at the last position.
- void
pause
();
- Pause playback of the sound.
- bool
paused
();
- Is the sound currently
paused
(or stopped?)
- void
seek
(double seconds);
- Seek to the position in the track. Seek has a precision of .05 seconds.
- double
tell
();
- Tell the position of the playback of the current sound file, in seconds.
- void
stop
();
- Stop the SoundNode from playing and rewind it to the beginning.
- char[]
toString
();
char[]
toString
(bool recurse);
- Return a string representation of this Node for human reading.
Params:
recurse |
Print this Node's children as well. |
|