#include <u_audio_mixer.h>
Inheritance diagram for NLSOUND::UAudioMixer:
The logical sources represent all entities in the world, from the client's point of view. Their number can be higher than the number of simultaneous playable sound on the soundcard.
When there are more sources than tracks, the process of choosing which sources go into the tracks is called "balancing". The source are auto-balanced according to the argument passed to init(). The sources are also balanced when
Important: The user is responsible for deleting the sources that have been allocated by createSource(), before deleting the audio mixer object.
Nevrax France
Definition at line 82 of file u_audio_mixer.h.
Move the primitive. | |
virtual void | init (uint maxTrack=32, bool useEax=true, bool useADPCM=true, NLMISC::IProgressCallback *progressCallBack=NULL, bool autoLoadSample=false)=0 |
virtual void | initClusteredSound (NL3D::CScene *scene, float minGain, float maxDistance, float portalInterpolate=20.0f)=0 |
virtual void | initClusteredSound (NL3D::UScene *uscene, float minGain, float maxDistance, float portalInterpolate=20.0f)=0 |
virtual void | setLowWaterMark (uint value)=0 |
virtual void | setPackedSheetOption (const std::string &path, bool update)=0 |
virtual void | setPriorityReserve (TSoundPriority priorityChannel, uint reserve)=0 |
virtual void | setSamplePath (const std::string &path)=0 |
UAudioMixer * | createAudioMixer () |
Create the audio mixer singleton and return a pointer to its instance. | |
Public Member Functions | |
virtual USource * | createSource (TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam=NULL, NL3D::CCluster *cluster=0, CSoundContext *context=0)=0 |
Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*). | |
virtual USource * | createSource (const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *callbackUserParam=NULL, NL3D::CCluster *cluster=0, CSoundContext *context=0)=0 |
virtual void | enable (bool b)=0 |
Disables or reenables the sound. | |
virtual UListener * | getListener ()=0 |
Return the listener interface. | |
virtual TSoundId | getSoundId (const NLMISC::TStringId &name)=0 |
Get a TSoundId from a name (returns NULL if not found). | |
virtual void | reset ()=0 |
Resets the audio system (deletes all the sources, include envsounds). | |
virtual void | selectEnvEffects (const std::string &tag)=0 |
virtual void | setListenerPos (const NLMISC::CVector &pos)=0 |
virtual void | update ()=0 |
Update audio mixer (call evenly). | |
virtual | ~UAudioMixer () |
Destructor. | |
virtual void | displayDriverBench (NLMISC::CLog *log)=0 |
virtual void | endDriverBench ()=0 |
virtual void | startDriverBench ()=0 |
virtual uint | getAvailableTracksCount () const=0 |
Return the number of available tracks. | |
virtual uint | getMutedPlayingSourcesCount () const=0 |
Return the number muted playing source. | |
virtual void | getPlayingSoundsPos (bool virtualPos, std::vector< std::pair< bool, NLMISC::CVector > > &pos)=0 |
Return the number of available tracks. | |
virtual uint | getPlayingSourcesCount () const=0 |
Return the number of playing sources. | |
virtual uint | getPolyphony () const=0 |
Return the number of mixing tracks (voices). | |
virtual void | getSoundNames (std::vector< NLMISC::TStringId > &names) const=0 |
Fill a vector with the names of all loaded sounds. | |
virtual uint | getSourcesInstanceCount () const=0 |
Return the number of sources. | |
virtual std::string | getSourcesStats () const=0 |
Return a string showing the playing sources. | |
virtual uint | getUsedTracksCount () const=0 |
Return the number of used tracks. | |
virtual void | writeProfile (std::ostream &out)=0 |
virtual const TBackgroundFilterFades & | getBackgroundFilterFades ()=0 |
virtual const std::string & | getBackgroundFlagName (uint flagIndex)=0 |
virtual const TBackgroundFlags & | getBackgroundFlags ()=0 |
virtual const std::string & | getBackgroundFlagShortName (uint flagIndex)=0 |
virtual void | loadBackgroundAudioFromPrimitives (const NLLIGO::IPrimitive &audioRoot)=0 |
virtual void | loadBackgroundEffectsFromRegion (const NLLIGO::CPrimRegion ®ion)=0 |
Deprecated. | |
virtual void | loadBackgroundSamplesFromRegion (const NLLIGO::CPrimRegion ®ion)=0 |
Deprecated. | |
virtual void | loadBackgroundSound (const std::string &continent, NLLIGO::CLigoConfig &config)=0 |
virtual void | loadBackgroundSoundFromRegion (const NLLIGO::CPrimRegion ®ion)=0 |
Deprecated. | |
virtual void | playBackgroundSound ()=0 |
virtual void | setBackgroundFilterFades (const TBackgroundFilterFades &backgroundFilterFades)=0 |
virtual void | setBackgroundFlagName (uint flagIndex, const std::string &flagName)=0 |
virtual void | setBackgroundFlags (const TBackgroundFlags &backgroundFlags)=0 |
virtual void | setBackgroundFlagShortName (uint flagIndex, const std::string &flagShortName)=0 |
virtual void | stopBackgroundSound ()=0 |
virtual void | getLoadedSampleBankInfo (std::vector< std::pair< std::string, uint > > &result)=0 |
virtual uint32 | getLoadedSampleSize ()=0 |
virtual uint32 | loadSampleBank (bool async, const std::string &filename, std::vector< std::string > *notfoundfiles=NULL)=0 |
virtual void | reloadSampleBanks (bool async)=0 |
virtual bool | unloadSampleBank (const std::string &filename)=0 |
virtual float | getUserVar (NLMISC::TStringId varName)=0 |
Return the current value of a user var. | |
virtual void | setUserVar (NLMISC::TStringId varName, float value)=0 |
|
Destructor.
Definition at line 328 of file u_audio_mixer.h.
00328 {} |
|
Create the audio mixer singleton and return a pointer to its instance.
Definition at line 103 of file audio_mixer_user.cpp.
00104 { 00105 NL_ALLOC_CONTEXT(NLSOUND_UAudioMixer); 00106 return new CAudioMixerUser(); 00107 } |
|
Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*).
Implemented in NLSOUND::CAudioMixerUser. |
|
Add a logical sound source (returns NULL if name not found). If spawn is true, the source will auto-delete after playing. If so, the return USource* pointer is valid only before the time when calling play() plus the duration of the sound. You can pass a callback function that will be called (if not NULL) just before deleting the spawned source. Implemented in NLSOUND::CAudioMixerUser. Referenced by NL3D::CPSSoundServImpl::createSound(), and NLSOUND::CSoundAnimMarker::play(). |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Disables or reenables the sound.
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number of available tracks.
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the listener interface.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return a list of loaded sample bank with theire size. Implemented in NLSOUND::CAudioMixerUser. |
|
Return the total size in byte of loaded samples. Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number muted playing source.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number of available tracks.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number of playing sources.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number of mixing tracks (voices).
Implemented in NLSOUND::CAudioMixerUser. |
|
Get a TSoundId from a name (returns NULL if not found).
Implemented in NLSOUND::CAudioMixerUser. |
|
Fill a vector with the names of all loaded sounds.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number of sources.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return a string showing the playing sources.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the number of used tracks.
Implemented in NLSOUND::CAudioMixerUser. |
|
Return the current value of a user var.
Implemented in NLSOUND::CAudioMixerUser. |
|
Initialization In case of failure, can throw one of these ESoundDriver (Exception) objects: ESoundDriverNotFound, ESoundDriverCorrupted, ESoundDriverOldVersion, ESoundDriverUnknownVersion. You can ask for EAX support. If EAX support is requested, then the mixer will try to allocate hardware accelerated audio tracks. If the total of available harware track is less than 10, then EAX is automaticaly deactivated. autoLoadSample is used for tools like george or object viewer where you don't bother to specifie each sample bank to load, you just want to ear the sound. Implemented in NLSOUND::CAudioMixerUser. |
|
Initialisation of the clustered sound system. CNELU version Implemented in NLSOUND::CAudioMixerUser. |
|
Initialisation of the clustered sound system. Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Deprecated.
Implemented in NLSOUND::CAudioMixerUser. |
|
Deprecated.
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Deprecated.
Implemented in NLSOUND::CAudioMixerUser. |
|
Load buffers. Returns the number of buffers successfully loaded. If you specify a non null notfoundfiles vector, it is filled with the names of missing files if any.
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Reload all the sample bank. Thid method use provided for use in a sound editor or sound tool to update the list of available samples. If true, the samples are loaded in a background thread. Implemented in NLSOUND::CAudioMixerUser. |
|
Resets the audio system (deletes all the sources, include envsounds).
Implemented in NLSOUND::CAudioMixerUser. |
|
Choose the environmental effect(s) corresponding to tag
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Use this method to set the listener position instead of using getListener->setPos(); It's because we have to update the background sounds in this case. Implemented in NLSOUND::CAudioMixerUser. |
|
Set the Low water mark. This value is use to mute sound source that try to play when there priority channel is full (see setPriorityReserve). Set a value 1 to 4 to keep some extra track available when a HighestPri source need to play. By default, the value is set to 0, witch mean no special treatment is done and the mixer will mute sound with no user control at all. Note also that the availability of a track is not guarantie if the sum of the priority reserve (see setPriorityReserve) is grater than the number od available tracks (witch is almos alwais the case). But this value will help the mixer make it's best. Implemented in NLSOUND::CAudioMixerUser. |
|
Set the global path to the packeck sheet files. This must be set BEFORE calling init. Default is to store packed sheet in the current directory. Implemented in NLSOUND::CAudioMixerUser. |
|
Set the priority channel reserve. Each priority channel can be assign a restrictive reserve value. This value is used when the number free track available for playing drop under the low water mark value (see setLowWaterMark). The mixer count the number of playing source in each priority channel. A priority channel can orverflow it's reserve value only if the low water mark is not reach. In other word, when the number of played source increase, you can control a 'smooth' cut in priority layer. The idea is to try to keep some free track for the HighestPri source. By default, reserve are set for each channel to the number of available tracks. Implemented in NLSOUND::CAudioMixerUser. |
|
Set the global path to the sample banks If you have specified some sample bank to load in the mixer comfig file, you MUST set the sample path BEFORE calling init. Implemented in NLSOUND::CAudioMixerUser. |
|
Set the value of a user variable. User variable are variable that can be used to control the gain or tranpose of all the instance (source) of a given sound. This has been initialy design to control the gain of any source playing some atmospheric sound (like rain) according to the intensity of the effect (ie small rain or big rain). Binding from user var to sound parameter is done in one or more george sheet .user_var_binding. Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Implemented in NLSOUND::CAudioMixerUser. |
|
Unload buffers. Return false if the bank can't be unloaded because an async loading is running. Implemented in NLSOUND::CAudioMixerUser. |
|
Update audio mixer (call evenly).
Implemented in NLSOUND::CAudioMixerUser. |
|
Write profiling information about the mixer to the output stream.
Implemented in NLSOUND::CAudioMixerUser. |