Home | Hierarchy | Members | Alphabetical | Related Pages |
#include <audioclip.h>
Inherits Node.
Inheritance diagram for AudioClip:
Public Member Functions | |
AudioClip (const char *name="") | |
virtual | ~AudioClip () |
virtual unsigned int | nbFields () const |
virtual FieldHandle | field (const std::string &n) |
virtual FieldHandle | field (const unsigned int i) |
virtual bool | isSetToDefaultValue (const unsigned int i) const |
virtual unsigned int | nbEventsIn () const |
virtual EventInHandle | eventIn (const std::string &n) |
virtual EventInHandle | eventIn (const unsigned int i) |
virtual unsigned int | nbEventsOut () const |
virtual EventOutHandle | eventOut (const std::string &n) |
virtual EventOutHandle | eventOut (const unsigned int i) |
const char * | typeName () const |
virtual Node * | duplicate () const |
virtual Node * | duplicate (std::map< const Node *, Node * > &) const |
Public Attributes | |
Exposed Fields | |
A field that is capable of receiving events via an eventIn to change its value(s), and generating events via an eventOut when its value(s) change. | |
SFString | description |
SFBool | loop |
SFFloat | pitch |
SFTime | startTime |
SFTime | stopTime |
MFString | url |
Events In | |
EventIn< SFString > | set_description |
EventIn< SFBool > | set_loop |
EventIn< SFFloat > | set_pitch |
EventIn< SFTime > | set_startTime |
EventIn< SFTime > | set_stopTime |
EventIn< MFString > | set_url |
Events Out | |
EventOut< SFTime > | duration_changed |
EventOut< SFBool > | isActive |
EventOut< SFString > | description_changed |
EventOut< SFBool > | loop_changed |
EventOut< SFFloat > | pitch_changed |
EventOut< SFTime > | startTime_changed |
EventOut< SFTime > | stopTime_changed |
EventOut< MFString > | url_changed |
An AudioClip node specifies audio data that can be referenced by Sound nodes.
The description field specifies a textual description of the audio source. A browser is not required to display the description field but may choose to do so in addition to playing the sound.
The url field specifies the URL from which the sound is loaded. Browsers shall support at least the wavefile format in uncompressed PCM format (see E.[WAV]). It is recommended that browsers also support the MIDI file type 1 sound format (see 2.[MIDI]); MIDI files are presumed to use the General MIDI patch set. Subclause 4.5, VRML and the World Wide Web, contains details on the url field. The results are undefined when no URLs refer to supported data types
The loop, startTime, and stopTime exposedFields and the isActive eventOut, and their effects on the AudioClip node, are discussed in detail in 4.6.9, Time-dependent nodes. The "cycle" of an AudioClip is the length of time in seconds for one playing of the audio at the specified pitch.
The pitch field specifies a multiplier for the rate at which sampled sound is played. Values for the pitch field shall be greater than zero. Changing the pitch field affects both the pitch and playback speed of a sound. A set_pitch event to an active AudioClip is ignored and no pitch_changed eventOut is generated. If pitch is set to 2.0, the sound shall be played one octave higher than normal and played twice as fast. For a sampled sound, the pitch field alters the sampling rate at which the sound is played. The proper implementation of pitch control for MIDI (or other note sequence sound clips) is to multiply the tempo of the playback by the pitch value and adjust the MIDI Coarse Tune and Fine Tune controls to achieve the proper pitch change.
A duration_changed event is sent whenever there is a new value for the "normal" duration of the clip. Typically, this will only occur when the current url in use changes and the sound data has been loaded, indicating that the clip is playing a different sound source. The duration is the length of time in seconds for one cycle of the audio for a pitch set to 1.0. Changing the pitch field will not trigger a duration_changed event. A duration value of "-1" implies that the sound data has not yet loaded or the value is unavailable for some reason. A duration_changed event shall be generated if the AudioClip node is loaded when the VRML file is read or the AudioClip node is added to the scene graph.
The isActive eventOut may be used by other nodes to determine if the clip is currently active. If an AudioClip is active, it shall be playing the sound corresponding to the sound time (i.e., in the sound's local time system with sample 0 at time 0):
t = (now - startTime) modulo (duration / pitch)
|
Construct a node with all its fields set to default value, which is equivalent to the code below: description = string(""); loop = false; pitch = 1; startTime.setNbSeconds(0); stopTime.setNbSeconds(0); |
|
Virtual destructor, does nothing |
|
Implements Node. |
|
Returns a deep copy of this node, that is a fully independant node with all children (if any) also copied. This is mainly useful for instanciating protos. Implements Node. |
|
Return a handle on the Implements Node. |
|
Return a handle on the event in named
Implements Node. |
|
Return a handle on the
Implements Node. |
|
Return a handle on the event out named
Implements Node. |
|
Return a handle on the
Implements Node. |
|
Return a handle on the field named
Implements Node. |
|
Implements Node. |
|
Returns the number of events in for this node type. Implements Node. |
|
Returns the number of events out for this node type. Implements Node. |
|
Returns the number of fields (exposed or not) for this node type. Implements Node. |
|
Returns Implements Node. |
|
See Detailed Description for meaning of this field. Default value is set to description = string(""); |
|
Changed event associated to exposedField description |
|
See Detailed Description for meaning of this event. |
|
See Detailed Description for meaning of this event. |
|
See Detailed Description for meaning of this field. Default value is set to loop = false; |
|
Changed event associated to exposedField loop |
|
See Detailed Description for meaning of this field. Default value is set to pitch = 1; |
|
Changed event associated to exposedField pitch |
|
Set event associated to exposedField description |
|
Set event associated to exposedField loop |
|
Set event associated to exposedField pitch |
|
Set event associated to exposedField startTime |
|
Set event associated to exposedField stopTime |
|
Set event associated to exposedField url |
|
See Detailed Description for meaning of this field. Default value is set to startTime.setNbSeconds(0); |
|
Changed event associated to exposedField startTime |
|
See Detailed Description for meaning of this field. Default value is set to stopTime.setNbSeconds(0); |
|
Changed event associated to exposedField stopTime |
|
See Detailed Description for meaning of this field. Default value is set to MFString default value |
|
Changed event associated to exposedField url |
Generated on 24 Feb 2005 with
![]() |
|