SoVRMLSound(3)
๐ NAME ๐
SoVRMLSound โ okay bestie, this whole page is about the SoVRMLSound class, and what it does is represent a sound source. That's the vibe. ๐โจ
Straight out of the <strong>Library Functions Manual</strong>, and yeah โ we're doing SoVRMLSound(3) today.
โจ SYNOPSIS โจ
#include <Inventor/VRMLnodes/SoVRMLSound.h>
Inherits SoNode. ๐
๐ซถ Public Member Functions ๐ซถ
virtual SoType getTypeId (void) constโ the const, virtual type-id getter. iconic behavior.SoVRMLSound (void)โ the constructor, hiii ๐void setDopplerVelocity (float velocity)โ set that doppler velocity, take afloat.float getDopplerVelocity ()โ and get it back as afloat.void setDopplerFactor (float factor)โ set the doppler factor,floatin.float getDopplerFactor ()โ grab the doppler factor back out,float.void startPlaying (SoPath *path, void *userdataptr)โ kick off playback, takes aSoPath *and avoid *.void stopPlaying (SoPath *path, void *userdataptr)โ and stop it again, sameSoPath *+void *energy.void setBufferingProperties (int bufferLength, int numBuffers, SbTime sleepTime)โ set the buffering props: anint, anotherint, and anSbTime.void getBufferingProperties (int &bufferLength, int &numBuffers, SbTime &sleepTime)โ read those buffering props back through references. yes, refs. we love a reference. ๐virtual void audioRender (SoAudioRenderAction *action)โ the virtual audio render hook, takes anSoAudioRenderAction *.
๐ธ Public Member Functions inherited from SoNode ๐ธ
free stuff from the parent, no cap โ you didn't even have to write these:
void setOverride (const SbBool state)SbBool isOverride (void) constvoid setNodeType (const NodeType type)NodeType getNodeType (void) constvirtual SoNode * copy (SbBool copyconnections=0) constvirtual SbBool affectsState (void) constvirtual void doAction (SoAction *action)virtual void GLRender (SoGLRenderAction *action)virtual void GLRenderBelowPath (SoGLRenderAction *action)virtual void GLRenderInPath (SoGLRenderAction *action)virtual void GLRenderOffPath (SoGLRenderAction *action)virtual void callback (SoCallbackAction *action)virtual void getBoundingBox (SoGetBoundingBoxAction *action)virtual void getMatrix (SoGetMatrixAction *action)virtual void handleEvent (SoHandleEventAction *action)virtual void pick (SoPickAction *action)virtual void rayPick (SoRayPickAction *action)virtual void search (SoSearchAction *action)virtual void write (SoWriteAction *action)virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)virtual void grabEventsSetup (void)virtual void grabEventsCleanup (void)virtual void startNotify (void)virtual void notify (SoNotList *l)uint32_t getNodeId (void) constvirtual SoChildList * getChildren (void) constvirtual void writeInstance (SoOutput *out)virtual SoNode * addToCopyDict (void) constvirtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)virtual SoFieldContainer * copyThroughConnection (void) const
๐ Public Member Functions inherited from SoFieldContainer ๐
void setToDefaults (void)SbBool hasDefaultValues (void) constSbBool fieldsAreEqual (const SoFieldContainer *container) constvoid copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=0)SbBool set (const char *const fielddata)void get (SbString &fielddata)virtual int getFields (SoFieldList &l) constvirtual int getAllFields (SoFieldList &l) constvirtual SoField * getField (const SbName &name) constvirtual SoField * getEventIn (const SbName &name) constvirtual SoField * getEventOut (const SbName &name) constSbBool getFieldName (const SoField *const field, SbName &name) constSbBool enableNotify (const SbBool flag)SbBool isNotifyEnabled (void) constSbBool set (const char *fielddata, SoInput *in)void get (SbString &fielddata, SoOutput *out)virtual SbBool validateNewFieldValue (SoField *field, void *newval)virtual void addWriteReference (SoOutput *out, SbBool isfromfield=0)SbBool getIsBuiltIn (void) constvoid setUserData (void *userdata) constvoid * getUserData (void) const
๐ฆ Public Member Functions inherited from SoBase ๐ฆ
void ref (void) constvoid unref (void) constvoid unrefNoDelete (void) constint32_t getRefCount (void) constvoid touch (void)SbBool isOfType (SoType type) constvirtual SbName getName (void) constvirtual void setName (const SbName &newname)void addAuditor (void *const auditor, const SoNotRec::Type type)void removeAuditor (void *const auditor, const SoNotRec::Type type)const SoAuditorList & getAuditors (void) constSbBool shouldWrite (void)void assertAlive (void) const
โญ Static Public Member Functions โญ
static SoType getClassTypeId (void)static void initClass (void)static void setDefaultBufferingProperties (int bufferLength, int numBuffers, SbTime sleepTime)โ set the default buffering props for everyone:int,int,SbTime. global tingz. ๐
๐ Static Public Member Functions inherited from SoNode ๐
static uint32_t getCompatibilityTypes (const SoType &nodetype)static SoType getClassTypeId (void)static SoNode * getByName (const SbName &name)static int getByName (const SbName &name, SoNodeList &l)static void initClass (void)static void initClasses (void)static uint32_t getNextNodeId (void)static int getActionMethodIndex (const SoType type)static void getBoundingBoxS (SoAction *action, SoNode *node)static void GLRenderS (SoAction *action, SoNode *node)static void callbackS (SoAction *action, SoNode *node)static void getMatrixS (SoAction *action, SoNode *node)static void handleEventS (SoAction *action, SoNode *node)static void pickS (SoAction *action, SoNode *node)static void rayPickS (SoAction *action, SoNode *node)static void searchS (SoAction *action, SoNode *node)static void writeS (SoAction *action, SoNode *node)static void audioRenderS (SoAction *action, SoNode *node)static void getPrimitiveCountS (SoAction *action, SoNode *node)
๐ง Static Public Member Functions inherited from SoFieldContainer ๐ง
static void initClass (void)static SoType getClassTypeId (void)static void initCopyDict (void)static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy)static SoFieldContainer * checkCopy (const SoFieldContainer *orig)static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections)static void copyDone (void)
๐ Static Public Member Functions inherited from SoBase ๐
static void initClass (void)static SoType getClassTypeId (void)static void addName (SoBase *const base, const char *const name)static void removeName (SoBase *const base, const char *const name)static void incrementCurrentWriteCounter (void)static void decrementCurrentWriteCounter (void)static SoBase * getNamedBase (const SbName &name, SoType type)static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type)static SbBool read (SoInput *in, SoBase *&base, SoType expectedtype)static void setInstancePrefix (const SbString &c)static void setTraceRefs (SbBool trace)static SbBool getTraceRefs (void)static SbBool connectRoute (SoInput *in, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)static SbBool readRoute (SoInput *in)
๐ Public Attributes ๐
the actual fields, bestie โ the data you get to poke at:
SoSFNode sourceSoSFFloat intensitySoSFFloat prioritySoSFVec3f locationSoSFVec3f directionSoSFFloat minFrontSoSFFloat maxFrontSoSFFloat minBackSoSFFloat maxBackSoSFBool spatialize
๐ Protected Member Functions ๐
virtual const SoFieldData * getFieldData (void) constvirtual ~SoVRMLSound (void)โ the destructor. protected. exclusive. ๐
๐ธ Protected Member Functions inherited from SoNode ๐ธ
SoNode (void)virtual ~SoNode ()virtual SbBool readInstance (SoInput *in, unsigned short flags)
๐ Protected Member Functions inherited from SoFieldContainer ๐
SoFieldContainer (void)~SoFieldContainer ()
๐ฆ Protected Member Functions inherited from SoBase ๐ฆ
SoBase (void)virtual ~SoBase ()virtual void destroy (void)SbBool hasMultipleWriteRefs (void) constSbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) constvoid writeFooter (SoOutput *out) constvirtual const char * getFileFormatName (void) const
๐ก๏ธ Static Protected Member Functions ๐ก๏ธ
static const SoFieldData ** getFieldDataPtr (void)
โจ Static Protected Member Functions inherited from SoNode โจ
static const SoFieldData ** getFieldDataPtr (void)static void setNextActionMethodIndex (int index)static int getNextActionMethodIndex (void)static void incNextActionMethodIndex (void)static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask)
๐ Static Protected Member Functions inherited from SoBase ๐
static uint32_t getCurrentWriteCounter (void)static void staticDataLock (void)static void staticDataUnlock (void)
๐ฏ Friends ๐ฏ
class SoVRMLSoundPโ bestie privileges only, iykyk. ๐ค
๐ซถ Additional Inherited Members ๐ซถ
๐ท๏ธ Public Types inherited from SoNode
the whole NodeType enum, every single flag, no skips:
enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400,
COIN_2_3 = 0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000,
COIN_2_5 = 0x4000 }
๐ท๏ธ Protected Types inherited from SoBase
enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }
๐ฆ Protected Attributes inherited from SoNode
uint32_t uniqueId
๐ฆ Protected Attributes inherited from SoFieldContainer
SbBool isBuiltIn
๐ฆ Static Protected Attributes inherited from SoNode
static uint32_t nextUniqueId = 0static int nextActionMethodIndex = 0
and that's just the SYNOPSIS, bestie โ we are NOT done yet, keep scrolling, there's more of this page coming ๐ โจ
Detailed Description ๐งโจ
okay so bestie, SoVRMLSound is literally the class that represents a sound source. no cap. ๐
The detailed class documentation is taken verbatim from the VRML97 standard (ISO/IEC 14772-1:1997). It is copyright The Web3D Consortium, and is used by permission of the Consortium: ๐ธ
Sound {
exposedField SFVec3f direction 0 0 1 # (-inf, inf)
exposedField SFFloat intensity 1 # [0,1]
exposedField SFVec3f location 0 0 0 # (-inf, inf)
exposedField SFFloat maxBack 10 # [0,inf)
exposedField SFFloat maxFront 10 # [0,inf)
exposedField SFFloat minBack 1 # [0,inf)
exposedField SFFloat minFront 1 # [0,inf)
exposedField SFFloat priority 0 # [0,1]
exposedField SFNode source NULL
field SFBool spatialize TRUE
}
The Sound node specifies the spatial presentation of a sound in a VRML scene. The sound is located at a point in the local coordinate system and emits sound in an elliptical pattern (defined by two ellipsoids). The ellipsoids are oriented in a direction specified by the direction field. The shape of the ellipsoids may be modified to provide more or less directional focus from the location of the sound. ๐ฆ
The source field specifies the sound source for the Sound node. If the source field is not specified, the Sound node will not emit audio. The source field shall specify either an AudioClip node or a MovieTexture node. If a MovieTexture node is specified as the sound source, the MovieTexture shall refer to a movie format that supports sound (e.g., MPEG1-Systems). ๐ฌ
The intensity field adjusts the loudness (decibels) of the sound emitted by the Sound node (note: this is different from the traditional definition of intensity with respect to sound). ๐
The intensity field has a value that ranges from 0.0 to 1.0 and specifies a factor which shall be used to scale the normalized sample data of the sound source during playback. A Sound node with an intensity of 1.0 shall emit audio at its maximum loudness (before attenuation), and a Sound node with an intensity of 0.0 shall emit no audio. Between these values, the loudness should increase linearly from a -20 dB change approaching an intensity of 0.0 to a 0 dB change at an intensity of 1.0. ๐
The priority field provides a hint for the browser to choose which sounds to play when there are more active Sound nodes than can be played at once due to either limited system resources or system load. 7.3.4, Sound priority, attenuation, and spatialization (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#7.3.4), describes a recommended algorithm for determining which sounds to play under such circumstances. The priority field ranges from 0.0 to 1.0, with 1.0 being the highest priority and 0.0 the lowest priority. ๐
The location field determines the location of the sound emitter in the local coordinate system. A Sound node's output is audible only if it is part of the traversed scene. Sound nodes that are descended from LOD, Switch, or any grouping or prototype node that disables traversal (i.e., drawing) of its children are not audible unless they are traversed. If a Sound node is disabled by a Switch or LOD node, and later it becomes part of the traversal again, the sound shall resume where it would have been had it been playing continuously. ๐
The Sound node has an inner ellipsoid that defines a volume of space in which the maximum level of the sound is audible. Within this ellipsoid, the normalized sample data is scaled by the intensity field and there is no attenuation. The inner ellipsoid is defined by extending the direction vector through the location. ๐ฅ
The minBack and minFront fields specify distances behind and in front of the location along the direction vector respectively. The inner ellipsoid has one of its foci at location (the second focus is implicit) and intersects the direction vector at minBack and minFront. The Sound node has an outer ellipsoid that defines a volume of space that bounds the audibility of the sound. No sound can be heard outside of this outer ellipsoid. ๐ซ๐
The outer ellipsoid is defined by extending the direction vector through the location. The maxBack and maxFront fields specify distances behind and in front of the location along the direction vector respectively. The outer ellipsoid has one of its foci at location (the second focus is implicit) and intersects the direction vector at maxBack and maxFront. The minFront, maxFront, minBack, and maxBack fields are defined in local coordinates, and shall be greater than or equal to zero. The minBack field shall be less than or equal to maxBack, and minFront shall be less than or equal to maxFront. The ellipsoid parameters are specified in the local coordinate system but the ellipsoids' geometry is affected by ancestors' transformations. ๐ง
Between the two ellipsoids, there shall be a linear attenuation ramp in loudness, from 0 dB at the minimum ellipsoid to -20 dB at the maximum ellipsoid: attenuation = -20 ร (d' / d") where d' is the distance along the location-to-viewer vector, measured from the transformed minimum ellipsoid boundary to the viewer, and d" is the distance along the location-to-viewer vector from the transformed minimum ellipsoid boundary to the transformed maximum ellipsoid boundary (see Figure 6.14). ๐
Figure 6.14 -- Sound node geometry
The spatialize field specifies if the sound is perceived as being directionally located relative to the viewer. If the spatialize field is TRUE and the viewer is located between the transformed inner and outer ellipsoids, the viewer's direction and the relative location of the Sound node should be taken into account during playback. Details outlining the minimum required spatialization functionality can be found in 7.3.4, Sound priority, attenuation, and spatialization (http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/part1/concepts.html#7.3.4). If the spatialize field is FALSE, then directional effects are ignored, but the ellipsoid dimensions and intensity will still affect the loudness of the sound. If the sound source is multi-channel (e.g., stereo), then the source should retain its channel separation during playback. ๐ง๐ซ
Constructor & Destructor Documentation ๐ ๏ธ
SoVRMLSound::SoVRMLSound (void )
Constructor.
References direction, SoAudioDevice::instance(), intensity, location, maxBack, maxFront, minBack, minFront, SoDebugError::postInfo(), SoDebugError::postWarning(), priority, source, SoVRMLSound(), and spatialize.
Referenced by getFieldData(), and SoVRMLSound().
SoVRMLSound::~SoVRMLSound (void ) [protected], [virtual]
Destructor. ๐
Member Function Documentation ๐ง
SoType SoVRMLSound::getTypeId (void ) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and "downward" casting.
Usage example:
void foo(SoNode * node)
{
if (node->getTypeId() == SoFile::getClassTypeId()) {
SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type
}
else if (node->getTypeId().isOfType(SoGroup::getClassTypeId())) {
SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type
}
}
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Implements SoBase. ๐ซถ
const SoFieldData * SoVRMLSound::getFieldData (void ) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.
Reimplemented from SoFieldContainer.
References SoNode::audioRenderS(), and SoVRMLSound().
void SoVRMLSound::setDopplerVelocity (float velocity)
Sets the doppler velocity relative to the global coordinate system. Not implemented yet.
References SoDebugError::postWarning().
float SoVRMLSound::getDopplerVelocity ()
Returns the doppler velocity relative to the global coordinate system. Not implemented yet.
References SoDebugError::postWarning().
void SoVRMLSound::setDopplerFactor (float factor)
Sets the doppler factor. Not implemented yet.
References SoDebugError::postWarning().
float SoVRMLSound::getDopplerFactor ()
Returns the doppler factor. Not implemented yet.
References SoDebugError::postWarning().
void SoVRMLSound::startPlaying (SoPath * path, void * userdataptr)
Starts playing the sound. Not implemented yet. Please use the fields of SoVRMLAudioClip to start and stop sounds.
References SoDebugError::postWarning().
void SoVRMLSound::stopPlaying (SoPath * path, void * userdataptr)
Stops playing the sound. Not implemented yet. Please use the fields of SoVRMLAudioClip to start and stop sounds.
References SoDebugError::postWarning().
void SoVRMLSound::audioRender (SoAudioRenderAction * action) [virtual]
Action method for SoAudioRenderAction.
Does common processing for SoAudioRenderAction action instances.
Reimplemented from SoNode.
References direction, SoListenerGainElement::get(), SoListenerOrientationElement::get(), SoListenerPositionElement::get(), SoListenerDopplerElement::getDopplerVelocity(), SoAction::getState(), SbRotation::getValue(), SbVec3f::getValue(), SoAudioDevice::instance(), intensity, SbRotation::inverse(), SbVec3f::length(), location, maxBack, maxFront, minBack, minFront, SbRotation::multVec(), SbVec3f::normalize(), SoDebugError::postInfo(), SoDebugError::postWarning(), and spatialize. ๐ฅ
โจ Member Data Documentation โจ
okay bestie, hereโs the field-by-field tea on SoVRMLSound ๐ every default, every value, every โreferenced byโ โ all of it. no skips, no cap.
๐ SoSFNode SoVRMLSound::source ๐
The audio stream. Either an SoVRMLAudioClip or an SoVRMLMovieTexture.
Coin only supports playback of audio from SoVRMLAudioClip, not from SoVRMLMovieTexture.
Referenced by SoVRMLSound().
๐
SoSFFloat SoVRMLSound::intensity ๐
Sound intensity. A value from 0 to 1. Default value is 1.
Referenced by audioRender(), and SoVRMLSound().
๐ฎ SoSFFloat SoVRMLSound::priority ๐ฎ
Browser hint for how important the sound is. A value from 0 to 1. Default value is 0.
Coin does not yet support this field. so rn itโs giving โconcept,โ not โfunctional,โ bestie ๐ญ
Referenced by SoVRMLSound().
๐ฆ SoSFVec3f SoVRMLSound::location ๐ฆ
The sound position. Default value is (0, 0, 0).
Referenced by audioRender(), and SoVRMLSound().
๐ SoSFVec3f SoVRMLSound::direction ๐
Sound direction. Default value is (0, 0, 1).
Referenced by audioRender(), and SoVRMLSound().
๐ SoSFFloat SoVRMLSound::minFront ๐
Inner ellipse front value. Default value is 1.
Referenced by audioRender(), and SoVRMLSound().
โญ SoSFFloat SoVRMLSound::maxFront โญ
Outer ellipse front value. Default value is 10.
Referenced by audioRender(), and SoVRMLSound().
๐ง SoSFFloat SoVRMLSound::minBack ๐ง
Inner ellipse back value. Default value is 1.
Referenced by audioRender(), and SoVRMLSound().
๐ฅ SoSFFloat SoVRMLSound::maxBack ๐ฅ
Outer ellips back value. Default value is 10.
Referenced by audioRender(), and SoVRMLSound().
๐ SoSFBool SoVRMLSound::spatialize ๐
Set to TRUE if sound should be spatialized (directional effects are applied) with respect to the viewer. Distance attenuation is always applied. Default value is TRUE.
Referenced by audioRender(), and SoVRMLSound().
๐ Author
Generated automatically by Doxygen for Coin from the source code.
Coin, Version 2.5.0, SoVRMLSound(3) โ auto-generated by Doxygen, no date in the footer, but itโs giving timeless icon energy ๐โจ
๐ฆ where this page comes from
- fedora 43: Coin2-devel 2.5.0-52.fc43 ยท GPL-2.0-only
- fedora 43: Coin2-devel 2.5.0-52.fc43 ยท GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 ยท GPL-2.0-only
- fedora 44: Coin2-devel 2.5.0-54.fc44 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms