QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::Sound Struct Reference
[Audio]

Geom for playing back positional sound. More...

#include <Q/q.h>

Inheritance diagram for Q::Sound:

Q::Geom Q::Object Q::ObjectBase List of all members.

Public Member Functions

 Sound ()
 Sound (const char *name)
float falloff () const
float range () const
float fadeIn () const
float fadeOut () const
AudioEffect effectOverride () const
Utils::Result setFalloff (float)
Utils::Result setRange (float)
Utils::Result setFade (float in, float out)
Utils::Result setEffectOverride (const AudioEffect &)
SampleIterator samples ()

Static Public Member Functions

Sound create (const char *name, const Database &db=Database())
Sound find (const char *name)
ClassType classType ()
Sound cast (const ObjectBase &)

Detailed Description

Geom for playing back positional sound.

A Sound object represents a sound emitter, defined by its box and falloff, and list of samples to be played. Samples can be accessed through their iterator. A Sound object has a default falloff 10.0f, a default range of 100.0f, and default fade in/out of 0.0f.

See also:
SimpleSound

QDemo2 production guide for guidance on how to build and import sound files in Q files.


Constructor & Destructor Documentation

Q::Sound::Sound  )  [inline]
 

Create a null Sound reference.

Q::Sound::Sound const char *  name  ) 
 

Search the currently attached databases for a Sound with the given name.


Member Function Documentation

Sound Q::Sound::cast const ObjectBase  )  [static]
 

If the object referenced by obj is a sound, then return a suitable Sound reference to the object.

Note:
Casting this object will cause it to be loaded from the database if it is not currently resident.

Reimplemented from Q::Geom.

ClassType Q::Sound::classType  )  [static]
 

Return the type for this class.

Sound Q::Sound::create const char *  name,
const Database db = Database()
[static]
 

Create a new sound named name in the given databse, db, (or the most recently attached read-write database if db is null). The values of the new object's visible, intersectable, collidee, collider, boundsEvent and lightable flags are set to false.

AudioEffect Q::Sound::effectOverride  )  const
 

The effect override of this sound.

Note:
Overriding the effect of a Sound impacts all SoundInstance objects which do not have their effect overridden locally.

float Q::Sound::fadeIn  )  const
 

Return the time taken to go from silence up to playback volume when SoundInstance objects associated with this Sound start playing or enter the range of a Microphone while playing (e.g. looping sounds).

Note:
The silence volume is returned by SpeakerSet::silenceVolume.

float Q::Sound::fadeOut  )  const
 

Return the time taken to go from playback volume to silence when SoundInstance objects associated with this Sound stop playing or exit the range of a Microphone while playing.

Note:
The silence volume is returned by SpeakerSet::silenceVolume.

float Q::Sound::falloff  )  const
 

Return the falloff of the sound. This is the distance at which the volume is halved.

Sound Q::Sound::find const char *  name  )  [static]
 

Search the currently attached databases for a sound with the given name and return that object, if it exists.

float Q::Sound::range  )  const
 

Return the range of the sound. This defines the box within which the sound is audible.

SampleIterator Q::Sound::samples  ) 
 

Return an iterator that can be used to examine and edit the samples for a sound.

Utils::Result Q::Sound::setEffectOverride const AudioEffect  ) 
 

Set the effect override for this sound.

Note:
Overriding the effect of a Sound impacts all SoundInstance objects which do not have their effect overridden locally.

Utils::Result Q::Sound::setFade float  in,
float  out
 

Set the fading times (in and out). The parameter in indicates the time taken to go from silence up to playback volume when SoundInstance objects associated with this Sound start playing or enter the range of a Microphone while playing (e.g. looping sounds). The parameter out indicates the time taken to go from playback volume to silence when SoundInstance objects associated with this Sound stop playing or exit the range of a Microphone while playing.

Note:
The silence volume is returned by SpeakerSet::silenceVolume.

Utils::Result Q::Sound::setFalloff float   ) 
 

Set the falloff of the sound. This is the distance at which the volume is halved.

Utils::Result Q::Sound::setRange float   ) 
 

Set the range of the sound. This defines the box in which the sound is audible.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004