SoVRMLSound(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

✨ SoVRMLSound ✨

okay so bestie, welcome to SoVRMLSound(3) from the Library Functions Manual β€” this is the class that's out here representing a sound source, and honestly? it's giving main character energy for your 3D audio πŸŽ§πŸ’–


🌸 NAME 🌸

SoVRMLSound β€” the class used to represent a sound source. that's it, that's the whole job πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

first thing first, you gotta let the compiler know you're about that life:

#include <Inventor/VRMLnodes/SoVRMLSound.h>

and Inherits SoNode. yes bestie, it's part of the SoNode family tree, it ate and left no crumbs πŸ‘‘

πŸ’« Public Member Functions πŸ’«

the ones that are yours, the ones you actually call:

  • virtual SoType getTypeId (void) const β€” the classic "who am i" moment
  • SoVRMLSound (void) β€” constructor, she's born ✨
  • void setDopplerVelocity (float velocity) β€” set that doppler velocity, fr
  • float getDopplerVelocity (void) const β€” read it back
  • void setDopplerFactor (float factor) β€” set the doppler factor
  • float getDopplerFactor (void) const β€” get the doppler factor
  • void startPlaying (SoPath *path, void *userdataptr) β€” hit play 🎡
  • void stopPlaying (SoPath *path, void *userdataptr) β€” and... stop
  • void setBufferingProperties (int bufferLength, int numBuffers, SbTime sleepTime) β€” tweak the buffering vibes
  • void getBufferingProperties (int &bufferLength, int &numBuffers, SbTime &sleepTime) β€” read the buffering vibes back out
  • virtual void audioRender (SoAudioRenderAction *action) β€” the actual render moment πŸ”₯

🫢 Public Member Functions inherited from SoNode 🫢

bestie she's not doing this alone, she's got the whole family behind her. every single one, no cap:

void setOverride (const SbBool state)
SbBool isOverride (void) const
void setNodeType (const NodeType type)
NodeType getNodeType (void) const
virtual SoNode * copy (SbBool copyconnections=FALSE) const
virtual SbBool affectsState (void) const
virtual 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) const
virtual SoChildList * getChildren (void) const
virtual void writeInstance (SoOutput *out)
virtual SoNode * addToCopyDict (void) const
virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections)
virtual SoFieldContainer * copyThroughConnection (void) const

πŸ’œ Public Member Functions inherited from SoFieldContainer πŸ’œ

void setToDefaults (void)
SbBool hasDefaultValues (void) const
SbBool fieldsAreEqual (const SoFieldContainer *container) const
void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE)
SbBool set (const char *const fielddata)
void get (SbString &fielddata)
virtual int getFields (SoFieldList &l) const
virtual int getAllFields (SoFieldList &l) const
virtual SoField * getField (const SbName &name) const
virtual SoField * getEventIn (const SbName &name) const
virtual SoField * getEventOut (const SbName &name) const
SbBool getFieldName (const SoField *const field, SbName &name) const
SbBool enableNotify (const SbBool flag)
SbBool isNotifyEnabled (void) const
SbBool set (const char *fielddata, SoInput *input)
void get (SbString &fielddata, SoOutput *out)
virtual SbBool validateNewFieldValue (SoField *field, void *newval)
virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE)
SbBool getIsBuiltIn (void) const
virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) const
void setUserData (void *userdata) const
void * getUserData (void) const

πŸ¦‹ Public Member Functions inherited from SoBase πŸ¦‹

the OG base class, the ancestor, the blueprint:

void ref (void) const
void unref (void) const
void unrefNoDelete (void) const
int32_t getRefCount (void) const
void touch (void)
SbBool isOfType (SoType type) const
virtual SbName getName (void) const
virtual 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) const
SbBool shouldWrite (void)
void assertAlive (void) const

⭐ Static Public Member Functions ⭐

the ones you call on the class itself, no instance required, iconic behaviour:

  • static SoType getClassTypeId (void)
  • static void initClass (void)
  • static void setDefaultBufferingProperties (int bufferLength, int numBuffers, SbTime sleepTime)

🌈 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 cleanupClass (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 *input, SoBase *&base, SoType expectedtype)
static void setInstancePrefix (const SbString &c)
static void setTraceRefs (SbBool trace)
static SbBool getTraceRefs (void)
static SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname)
static SbBool readRoute (SoInput *input)

πŸ‘‘ Public Attributes πŸ‘‘

okay these are the actual fields, the data, the moment. twelve of them, all public, all ready for you:

  • SoSFNode source
  • SoSFFloat intensity
  • SoSFFloat priority
  • SoSFVec3f location
  • SoSFVec3f direction
  • SoSFFloat minFront
  • SoSFFloat maxFront
  • SoSFFloat minBack
  • SoSFFloat maxBack
  • SoSFBool spatialize
  • SoSFFloat dopplerFactor
  • SoSFFloat dopplerVelocity

πŸŽ€ Protected Member Functions πŸŽ€

for the class and her subclasses only, respectfully:

  • virtual const SoFieldData * getFieldData (void) const
  • virtual ~SoVRMLSound (void) β€” the destructor, she's leaving but make it graceful

inherited from SoNode

SoNode (void)
virtual ~SoNode ()
virtual SbBool readInstance (SoInput *in, unsigned short flags)

inherited from SoFieldContainer

SoFieldContainer (void)
virtual ~SoFieldContainer ()

inherited from SoBase

SoBase (void)
virtual ~SoBase ()
virtual void destroy (void)
SbBool hasMultipleWriteRefs (void) const
SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const
void writeFooter (SoOutput *out) const
virtual const char * getFileFormatName (void) const

πŸ’… Static Protected Member Functions πŸ’…

  • static const SoFieldData ** getFieldDataPtr (void)

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)

inherited from SoBase

static uint32_t getCurrentWriteCounter (void)
static void staticDataLock (void)
static void staticDataUnlock (void)

🌸 Additional Inherited Members 🌸

the deep lore. the stuff you inherit and lowkey forget about, but it's so real:

Public Types inherited from SoNode

the whole NodeType enum, every single value, she's serving range:

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,
    COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000 }

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 = 1
static int nextActionMethodIndex = 0

and bestie, we are SO not done yet β€” this was just part one of the whole saga πŸ’– there's more coming, don't go anywhere 🫢✨

✨ Detailed Description ✨

okay so the SoVRMLSound class is used to represent a sound source. that's the whole vibe. a little speaker floating in your 3D world, living its best life 🎡

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
}

bestie 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, not one, keep up πŸ’…). 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 (silent treatment, literally). 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 β€” and yes, note that this is different from the traditional definition of intensity with respect to sound. iykyk.

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. section 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. main character sounds get the 1.0 ✨

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 (no skipping, no restarting, it just picks right back up, we love continuity 🫢).

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. periodt.

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.

bestie. please respect the inequalities. minBack <= maxBack and minFront <= maxFront are not suggestions, they're the law πŸ’€

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. it makes the thing ✨

SoVRMLSound::~SoVRMLSound (void ) β€” [protected], [virtual]

Destructor. it unmakes the thing πŸ’€


🧚 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
  }
}

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.

void SoVRMLSound::setDopplerVelocity (float velocity)

Sets the doppler velocity relative to the global coordinate system. Not implemented yet.

float SoVRMLSound::getDopplerVelocity (void ) const

Returns the doppler velocity relative to the global coordinate system. Not implemented yet.

void SoVRMLSound::setDopplerFactor (float factor)

Sets the doppler factor. Not implemented yet.

float SoVRMLSound::getDopplerFactor (void ) const

Returns the doppler factor. Not implemented yet.

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.

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.

not me finding four doppler functions that literally do nothing yet 😭 bestie the doppler is aspirational

void SoVRMLSound::audioRender (SoAudioRenderAction * action) β€” [virtual]

Action method for SoAudioRenderAction.

Does common processing for SoAudioRenderAction action instances.

Reimplemented from SoNode.


🌸 Member Data Documentation 🌸

  • SoSFNode SoVRMLSound::source β€” the audio stream. either an SoVRMLAudioClip or an SoVRMLMovieTexture. Coin only supports playback of audio from SoVRMLAudioClip, not from SoVRMLMovieTexture.
  • SoSFFloat SoVRMLSound::intensity β€” sound intensity. a value from 0 to 1. default value is 1.
  • 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.
  • SoSFVec3f SoVRMLSound::location β€” the sound position. default value is (0, 0, 0).
  • SoSFVec3f SoVRMLSound::direction β€” sound direction. default value is (0, 0, 1).
  • SoSFFloat SoVRMLSound::minFront β€” inner ellipse front value. default value is 1.
  • SoSFFloat SoVRMLSound::maxFront β€” outer ellipse front value. default value is 10.
  • SoSFFloat SoVRMLSound::minBack β€” inner ellipse back value. default value is 1.
  • SoSFFloat SoVRMLSound::maxBack β€” outer ellips back value (that's their typo, not mine πŸ’€). default value is 10.
  • 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.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Coin from the source code.


and that's the whole page bestie!! πŸŽ€ this was Coin, Version 3.1.3, and you just read SoVRMLSound(3) β€” go make something that goes beep in 3D space, ily, slay, bye πŸ’–βœ¨

πŸ“¦ where this page comes from