# irrklang::ISoundEngine Class Reference

Interface to the sound engine, for playing 3d and 2d sound and music. More...

`#include <ik_ISoundEngine.h>`

Inheritance diagram for irrklang::ISoundEngine:

List of all members.

## Public Member Functions

virtual const char * | getDriverName ()=0
| returns the name of the sound driver, like 'ALSA' for the alsa device
virtual ISound * | play2D (const char *soundFileName, bool playLooped=false, bool startPaused=false, bool track=false, E_STREAM_MODE streamMode=ESM_AUTO_DETECT, bool enableSoundEffects=false)=0
| loads a sound source (if not loaded already) from a file and plays it.
virtual ISound * | play2D (ISoundSource *source, bool playLooped=false, bool startPaused=false, bool track=false, bool enableSoundEffects=false)=0
| Plays a sound source as 2D sound with its default settings stored in ISoundSource.
virtual ISound * | play3D (const char *soundFileName, vec3df pos, bool playLooped=false, bool startPaused=false, bool track=false, E_STREAM_MODE streamMode=ESM_AUTO_DETECT, bool enableSoundEffects=false)=0
| Loads a sound source (if not loaded already) from a file and plays it as 3D sound.
virtual ISound * | play3D (ISoundSource *source, vec3df pos, bool playLooped=false, bool startPaused=false, bool track=false, bool enableSoundEffects=false)=0
| Plays a sound source as 3D sound with its default settings stored in ISoundSource.
virtual void | stopAllSounds ()=0
| Stops all currently playing sounds.
virtual void | setAllSoundsPaused (bool bPaused=true)=0
| Pauses or unpauses all currently playing sounds.
virtual ISoundSource * | getSoundSource (const ik_c8 *soundName, bool addIfNotFound=true)=0
| Gets a sound source by sound name. Adds the sound source as file into the sound engine if not loaded already.
virtual ISoundSource * | getSoundSource (ik_s32 index)=0
| Returns a sound source by index.
virtual ik_s32 | getSoundSourceCount ()=0
| Returns amount of loaded sound sources.
virtual ISoundSource * | addSoundSourceFromFile (const ik_c8 *fileName, E_STREAM_MODE mode=ESM_AUTO_DETECT, bool preload=false)=0
| Adds sound source into the sound engine as file.
virtual ISoundSource * | addSoundSourceFromMemory (void *memory, ik_s32 sizeInBytes, const ik_c8 *soundName, bool copyMemory=true)=0
| Adds a sound source into the sound engine as memory source.
virtual ISoundSource * | addSoundSourceFromPCMData (void *memory, ik_s32 sizeInBytes, const ik_c8 *soundName, SAudioStreamFormat format, bool copyMemory=true)=0
| Adds a sound source into the sound engine from plain PCM data in memory.
virtual ISoundSource * | addSoundSourceAlias (ISoundSource *baseSource, const ik_c8 *soundName)=0
| Adds a sound source as alias for an existing sound source, but with a different name or optional different default settings.
virtual void | removeSoundSource (ISoundSource *source)=0
| Removes a sound source from the engine, freeing the memory it occupies.
virtual void | removeSoundSource (const ik_c8 *name)=0
| Removes a sound source from the engine, freeing the memory it occupies.
virtual void | removeAllSoundSources ()=0
| Removes all sound sources from the engine.
virtual void | setSoundVolume (ik_f32 volume)=0
| Sets master sound volume. This value is multiplied with all sounds played.
virtual ik_f32 | getSoundVolume ()=0
| Returns master sound volume.
virtual void | setListenerPosition (const vec3df &pos, const vec3df &lookdir, const vec3df &velPerSecond=vec3df(0, 0, 0), const vec3df &upVector=vec3df(0, 1, 0))=0
| Sets the current listener 3d position.
virtual void | update ()=0
| Updates the audio engine. This should be called several times per frame if irrKlang was started in single thread mode.
virtual bool | isCurrentlyPlaying (const char *soundName)=0
| Returns if a sound with the specified name is currently playing.
virtual bool | isCurrentlyPlaying (ISoundSource *source)=0
| Returns if a sound with the specified source is currently playing.
virtual void | stopAllSoundsOfSoundSource (ISoundSource *source)=0
| Stops all sounds of a specific sound source.
virtual void | registerAudioStreamLoader (IAudioStreamLoader *loader)=0
| Registers a new audio stream loader in the sound engine.
virtual bool | isMultiThreaded () const =0
| Returns if irrKlang is running in the same thread as the application or is using multithreading.
virtual void | addFileFactory (IFileFactory *fileFactory)=0
| Adds a file factory to the sound engine, making it possible to override file access of the sound engine.
virtual void | setDefault3DSoundMinDistance (ik_f32 minDistance)=0
| Sets the default minimal distance for 3D sounds.
virtual ik_f32 | getDefault3DSoundMinDistance ()=0
| Returns the default minimal distance for 3D sounds.
virtual void | setDefault3DSoundMaxDistance (ik_f32 maxDistance)=0
| Sets the default maximal distance for 3D sounds.
virtual ik_f32 | getDefault3DSoundMaxDistance ()=0
| Returns the default maximal distance for 3D sounds.
virtual void | setRolloffFactor (ik_f32 rolloff)=0
| Sets a rolloff factor which influences the amount of attenuation that is applied to 3D sounds.
virtual void | setDopplerEffectParameters (ik_f32 dopplerFactor=1.0f, ik_f32 distanceFactor=1.0f)=0
| Sets parameters affecting the doppler effect.
virtual bool | loadPlugins (const ik_c8 *path)=0
| Loads irrKlang plugins from a custom path.
virtual const SInternalAudioInterface & | getInternalAudioInterface ()=0
| Returns a pointer to internal sound engine pointers, like the DirectSound interface.
virtual bool | setMixedDataOutputReceiver (ISoundMixedOutputReceiver *receiver)=0
| Sets the OutputMixedDataReceiver, so you can receive the pure mixed output audio data while it is being played.

## Detailed Description

Interface to the sound engine, for playing 3d and 2d sound and music.

This is the main interface of irrKlang. You usually would create this using the createIrrKlangDevice() function.

## Member Function Documentation

virtual void irrklang::ISoundEngine::addFileFactory | ( | IFileFactory * | fileFactory | ) | `[pure virtual]`

Adds a file factory to the sound engine, making it possible to override file access of the sound engine.

Derive your own class from IFileFactory, overwrite the createFileReader() method and return your own implemented IFileReader to overwrite file access of irrKlang.

virtual ISoundSource* irrklang::ISoundEngine::addSoundSourceAlias | ( | ISoundSource * | baseSource,
|  | const ik_c8 * | soundName |
| ) |  |  | `[pure virtual]`

Adds a sound source as alias for an existing sound source, but with a different name or optional different default settings.

This is useful if you want to play multiple sounds but each sound isn't necessarily one single file. Also useful if you want to or play the same sound using different names, volumes or min and max 3D distances.

Parameters:

  | baseSource | The sound source where this sound source should be based on. This sound source will use the baseSource as base to access the file and similar, but it will have its own name and its own default settings.
  | soundName | Name of the new sound source to be added.

Returns:
  Returns the pointer to the added sound source or 0 if not sucessful because for example a sound already existed with that name. If not successful, the reason will be printed into the log.

virtual ISoundSource* irrklang::ISoundEngine::addSoundSourceFromFile | ( | const ik_c8 * | fileName,
|  | E_STREAM_MODE | mode = `ESM_AUTO_DETECT`,
|  | bool | preload = `false` |
| ) |  |  | `[pure virtual]`

Adds sound source into the sound engine as file.

Parameters:

  | fileName | Name of the sound file (e.g. "sounds/something.mp3"). You can also use this name when calling play3D() or play2D().
  | mode | Streaming mode for this sound source
  | preload | If this flag is set to false (which is default) the sound engine will not try to load the sound file when calling this method, but only when play() is called with this sound source as parameter. Otherwise the sound will be preloaded.

Returns:
  Returns the pointer to the added sound source or 0 if not sucessful because for example a sound already existed with that name. If not successful, the reason will be printed into the log. Note: Don't call drop() to this pointer, it will be managed by irrKlang and exist as long as you don't delete irrKlang or call removeSoundSource(). However, you are free to call grab() if you want and drop() it then later of course.

virtual ISoundSource* irrklang::ISoundEngine::addSoundSourceFromMemory | ( | void * | memory,
|  | ik_s32 | sizeInBytes,
|  | const ik_c8 * | soundName,
|  | bool | copyMemory = `true` |
| ) |  |  | `[pure virtual]`

Adds a sound source into the sound engine as memory source.

Note: This method only accepts a file (.wav, .ogg, etc) which is totally loaded into memory. If you want to add a sound source from decoded plain PCM data in memory, use addSoundSourceFromPCMData() instead.

Parameters:

  | memory | Pointer to the memory to be treated as loaded sound file.
  | sizeInBytes | Size of the memory chunk, in bytes.
  | soundName | Name of the virtual sound file (e.g. "sounds/something.mp3"). You can also use this name when calling play3D() or play2D(). Hint: If you include the extension of the original file like .ogg, .mp3 or .wav at the end of the filename, irrKlang will be able to decide better what file format it is and might be able to start playback faster.
  | copyMemory | If set to true which is default, the memory block is copied and stored in the engine, after calling addSoundSourceFromMemory() the memory pointer can be deleted savely. If set to false, the memory is not copied and the user takes the responsibility that the memory block pointed to remains there as long as the sound engine or at least this sound source exists.

Returns:
  Returns the pointer to the added sound source or 0 if not sucessful because for example a sound already existed with that name. If not successful, the reason will be printed into the log. Note: Don't call drop() to this pointer, it will be managed by irrKlang and exist as long as you don't delete irrKlang or call removeSoundSource(). However, you are free to call grab() if you want and drop() it then later of course.

virtual ISoundSource* irrklang::ISoundEngine::addSoundSourceFromPCMData | ( | void * | memory,
|  | ik_s32 | sizeInBytes,
|  | const ik_c8 * | soundName,
|  | SAudioStreamFormat | format,
|  | bool | copyMemory = `true` |
| ) |  |  | `[pure virtual]`

Adds a sound source into the sound engine from plain PCM data in memory.

Parameters:

  | memory | Pointer to the memory to be treated as loaded sound file.
  | sizeInBytes | Size of the memory chunk, in bytes.
  | soundName | Name of the virtual sound file (e.g. "sounds/something.mp3"). You can also use this name when calling play3D() or play2D().
  | copyMemory | If set to true which is default, the memory block is copied and stored in the engine, after calling addSoundSourceFromPCMData() the memory pointer can be deleted savely. If set to true, the memory is not copied and the user takes the responsibility that the memory block pointed to remains there as long as the sound engine or at least this sound source exists.

Returns:
  Returns the pointer to the added sound source or 0 if not sucessful because for example a sound already existed with that name. If not successful, the reason will be printed into the log.

virtual ik_f32 irrklang::ISoundEngine::getDefault3DSoundMaxDistance | ( |  | ) | `[pure virtual]`

Returns the default maximal distance for 3D sounds.

This value influences how loud a sound is heard based on its distance. You can change it using setDefault3DSoundmaxDistance(), but changing this value is usually not necessary. This value causes the sound to stop attenuating after it reaches the max distance. Most people think that this sets the volume of the sound to 0 after this distance, but this is not true. Only change the minimal distance (using for example setDefault3DSoundMinDistance()) to influence this. See ISound::setMaxDistance() for details about what the max distance is. It is also possible to influence this default value for every sound file using ISoundSource::setDefaultMaxDistance().

Returns:
  Default maximal distance for 3d sounds. The default value is 1000000000.0f.

virtual ik_f32 irrklang::ISoundEngine::getDefault3DSoundMinDistance | ( |  | ) | `[pure virtual]`

Returns the default minimal distance for 3D sounds.

This value influences how loud a sound is heard based on its distance. You can change it using setDefault3DSoundMinDistance(). See ISound::setMinDistance() for details about what the min distance is. It is also possible to influence this default value for every sound file using ISoundSource::setDefaultMinDistance().

Returns:
  Default minimal distance for 3d sounds. The default value is 1.0f.

virtual const char* irrklang::ISoundEngine::getDriverName | ( |  | ) | `[pure virtual]`

returns the name of the sound driver, like 'ALSA' for the alsa device

Possible returned strings are "NULL", "ALSA", "CoreAudio", "winMM", "DirectSound" and "DirectSound8".

virtual const SInternalAudioInterface& irrklang::ISoundEngine::getInternalAudioInterface | ( |  | ) | `[pure virtual]`

Returns a pointer to internal sound engine pointers, like the DirectSound interface.

Use this with caution. This is only exposed to make it possible for other libraries such as Video playback packages to extend or use the sound driver irrklang uses.

virtual ISoundSource* irrklang::ISoundEngine::getSoundSource | ( | ik_s32 | index | ) | `[pure virtual]`

Returns a sound source by index.

Parameters:

  | idx,: | Index of the loaded sound source, must by smaller than getSoundSourceCount().

Returns:
  Returns the sound source or 0 if not available. Note: Don't call drop() to this pointer, it will be managed by irrKlang and exist as long as you don't delete irrKlang or call removeSoundSource(). However, you are free to call grab() if you want and drop() it then later of course.

virtual ISoundSource* irrklang::ISoundEngine::getSoundSource | ( | const ik_c8 * | soundName,
|  | bool | addIfNotFound = `true` |
| ) |  |  | `[pure virtual]`

Gets a sound source by sound name. Adds the sound source as file into the sound engine if not loaded already.

Please note: For performance reasons most ISoundEngine implementations will not try to load the sound when calling this method, but only when play() is called with this sound source as parameter.

Parameters:

  | addIfNotFound | if 'true' adds the sound source to the list and returns the interface to it if it cannot be found in the sound source list. If 'false', returns 0 if the sound source is not in the list and does not modify the list. Default value: true.

Returns:
  Returns the sound source or 0 if not available. Note: Don't call drop() to this pointer, it will be managed by irrKlang and exist as long as you don't delete irrKlang or call removeSoundSource(). However, you are free to call grab() if you want and drop() it then later of course.

virtual ik_s32 irrklang::ISoundEngine::getSoundSourceCount | ( |  | ) | `[pure virtual]`

Returns amount of loaded sound sources.

virtual ik_f32 irrklang::ISoundEngine::getSoundVolume | ( |  | ) | `[pure virtual]`

Returns master sound volume.

virtual bool irrklang::ISoundEngine::isCurrentlyPlaying | ( | ISoundSource * | source | ) | `[pure virtual]`

Returns if a sound with the specified source is currently playing.

virtual bool irrklang::ISoundEngine::isCurrentlyPlaying | ( | const char * | soundName | ) | `[pure virtual]`

Returns if a sound with the specified name is currently playing.

virtual bool irrklang::ISoundEngine::isMultiThreaded | ( |  | ) | const`[pure virtual]`

Returns if irrKlang is running in the same thread as the application or is using multithreading.

This basicly returns the flag set by the user when creating the sound engine.

virtual bool irrklang::ISoundEngine::loadPlugins | ( | const ik_c8 * | path | ) | `[pure virtual]`

Loads irrKlang plugins from a custom path.

Plugins usually are .dll, .so or .dylib files named for example ikpMP3.dll (= short for irrKlangPluginMP3) which make it possible to play back mp3 files. Plugins are being loaded from the current working directory at startup of the sound engine if the parameter ESEO_LOAD_PLUGINS is set (which it is by default), but using this method, it is possible to load plugins from a custom path in addition.

Parameters:

  | path | Path to the plugin directory, like "C:\games\somegamegame\irrklangplugins".

Returns:
  returns true if sucessful or fals if not, for example because the path could not be found.

virtual ISound* irrklang::ISoundEngine::play2D | ( | ISoundSource * | source,
|  | bool | playLooped = `false`,
|  | bool | startPaused = `false`,
|  | bool | track = `false`,
|  | bool | enableSoundEffects = `false` |
| ) |  |  | `[pure virtual]`

Plays a sound source as 2D sound with its default settings stored in ISoundSource.

An ISoundSource object will be created internally when playing a sound the first time, or can be added with getSoundSource().

Parameters:

  | source | The sound source, specifiying sound file source and default settings for this file. Use the other ISoundEngine::play2D() overloads if you want to specify a filename string instead of this.
  | playLooped | plays the sound in loop mode. If set to 'false', the sound is played once, then stopped and deleted from the internal playing list. Calls to ISound have no effect after such a non looped sound has been stopped automaticly.

  startPaused

  starts the sound paused. This implies that track=true. Use this if you want to modify some of the playing parameters before the sound actually plays. Usually you would set this parameter to true, then use the ISound interface to modify some of the sound parameters and then call ISound::setPaused(false); Note: You need to call ISound::drop() when setting this parameter to true and you don't need the ISound object anymore. See 'return' for details.

  | track | Makes it possible to track the sound. Causes the method to return an ISound interface. See 'return' for details.
  | enableSoundEffects | Makes it possible to use sound effects such as chorus, distorsions, echo, reverb and similar for this sound. Sound effects can then be controlled via ISound::getSoundEffectControl(). Only enable if necessary.

Returns:
  Only returns a pointer to an ISound if the parameters 'track', 'startPaused' or 'enableSoundEffects' have been set to true. Note: if this method returns an ISound as result, you HAVE to call ISound::drop() after you don't need the ISound interface anymore. Otherwise this will cause memory waste. This method also may return 0 altough 'track', 'startPaused' or 'enableSoundEffects' have been set to true, if the sound could not be played.

virtual ISound* irrklang::ISoundEngine::play2D | ( | const char * | soundFileName,
|  | bool | playLooped = `false`,
|  | bool | startPaused = `false`,
|  | bool | track = `false`,
|  | E_STREAM_MODE | streamMode = `ESM_AUTO_DETECT`,
|  | bool | enableSoundEffects = `false` |
| ) |  |  | `[pure virtual]`

loads a sound source (if not loaded already) from a file and plays it.

Parameters:

  | sourceFileName | Filename of sound, like "sounds/test.wav" or "foobar.ogg".
  | playLooped | plays the sound in loop mode. If set to 'false', the sound is played once, then stopped and deleted from the internal playing list. Calls to ISound have no effect after such a non looped sound has been stopped automaticly.

  startPaused

  starts the sound paused. This implies that track=true. Use this if you want to modify some of the playing parameters before the sound actually plays. Usually you would set this parameter to true, then use the ISound interface to modify some of the sound parameters and then call ISound::setPaused(false); Note: You need to call ISound::drop() when setting this parameter to true and you don't need the ISound object anymore. See 'return' for details.

  | track | Makes it possible to track the sound. Causes the method to return an ISound interface. See 'return' for details.
  | streamMode | Specifies if the file should be streamed or loaded completely into memory for playing. ESM_AUTO_DETECT sets this to autodetection. Note: if the sound has been loaded or played before into the engine, this parameter has no effect.
  | enableSoundEffects | Makes it possible to use sound effects such as chorus, distorsions, echo, reverb and similar for this sound. Sound effects can then be controlled via ISound::getSoundEffectControl(). Only enable if necessary.

Returns:
  Only returns a pointer to an ISound if the parameters 'track', 'startPaused' or 'enableSoundEffects' have been set to true. Note: if this method returns an ISound as result, you HAVE to call ISound::drop() after you don't need the ISound interface anymore. Otherwise this will cause memory waste. This method also may return 0 altough 'track', 'startPaused' or 'enableSoundEffects' have been set to true, if the sound could not be played.

virtual ISound* irrklang::ISoundEngine::play3D | ( | ISoundSource * | source,
|  | vec3df | pos,
|  | bool | playLooped = `false`,
|  | bool | startPaused = `false`,
|  | bool | track = `false`,
|  | bool | enableSoundEffects = `false` |
| ) |  |  | `[pure virtual]`

Plays a sound source as 3D sound with its default settings stored in ISoundSource.

An ISoundSource object will be created internally when playing a sound the first time, or can be added with getSoundSource(). There is some example code on how to work with 3D sound 3D Sound.

Parameters:

  | source | The sound source, specifiying sound file source and default settings for this file. Use the other ISoundEngine::play2D() overloads if you want to specify a filename string instead of this.
  | pos | Position of the 3D sound.
  | playLooped | plays the sound in loop mode. If set to 'false', the sound is played once, then stopped and deleted from the internal playing list. Calls to ISound have no effect after such a non looped sound has been stopped automaticly.

  startPaused

  starts the sound paused. This implies that track=true. Use this if you want to modify some of the playing parameters before the sound actually plays. Usually you would set this parameter to true, then use the ISound interface to modify some of the sound parameters and then call ISound::setPaused(false); Note: You need to call ISound::drop() when setting this parameter to true and you don't need the ISound object anymore. See 'return' for details.

  | track | Makes it possible to track the sound. Causes the method to return an ISound interface. See 'return' for details.
  | enableSoundEffects | Makes it possible to use sound effects such as chorus, distorsions, echo, reverb and similar for this sound. Sound effects can then be controlled via ISound::getSoundEffectControl(). Only enable if necessary.

Returns:
  Only returns a pointer to an ISound if the parameters 'track', 'startPaused' or 'enableSoundEffects' have been set to true. Note: if this method returns an ISound as result, you HAVE to call ISound::drop() after you don't need the ISound interface anymore. Otherwise this will cause memory waste. This method also may return 0 altough 'track', 'startPaused' or 'enableSoundEffects' have been set to true, if the sound could not be played.

virtual ISound* irrklang::ISoundEngine::play3D | ( | const char * | soundFileName,
|  | vec3df | pos,
|  | bool | playLooped = `false`,
|  | bool | startPaused = `false`,
|  | bool | track = `false`,
|  | E_STREAM_MODE | streamMode = `ESM_AUTO_DETECT`,
|  | bool | enableSoundEffects = `false` |
| ) |  |  | `[pure virtual]`

Loads a sound source (if not loaded already) from a file and plays it as 3D sound.

There is some example code on how to work with 3D sound at 3D Sound.

Parameters:

  | sourceFileName | Filename of sound, like "sounds/test.wav" or "foobar.ogg".
  | pos | Position of the 3D sound.
  | playLooped | plays the sound in loop mode. If set to 'false', the sound is played once, then stopped and deleted from the internal playing list. Calls to ISound have no effect after such a non looped sound has been stopped automaticly.

  startPaused

  starts the sound paused. This implies that track=true. Use this if you want to modify some of the playing parameters before the sound actually plays. Usually you would set this parameter to true, then use the ISound interface to modify some of the sound parameters and then call ISound::setPaused(false); Note: You need to call ISound::drop() when setting this parameter to true and you don't need the ISound object anymore. See 'return' for details.

  | track | Makes it possible to track the sound. Causes the method to return an ISound interface. See 'return' for details.
  | streamMode | Specifies if the file should be streamed or loaded completely into memory for playing. ESM_AUTO_DETECT sets this to autodetection. Note: if the sound has been loaded or played before into the engine, this parameter has no effect.
  | enableSoundEffects | Makes it possible to use sound effects such as chorus, distorsions, echo, reverb and similar for this sound. Sound effects can then be controlled via ISound::getSoundEffectControl(). Only enable if necessary.

Returns:
  Only returns a pointer to an ISound if the parameters 'track', 'startPaused' or 'enableSoundEffects' have been set to true. Note: if this method returns an ISound as result, you HAVE to call ISound::drop() after you don't need the ISound interface anymore. Otherwise this will cause memory waste. This method also may return 0 altough 'track', 'startPaused' or 'enableSoundEffects' have been set to true, if the sound could not be played.

virtual void irrklang::ISoundEngine::registerAudioStreamLoader | ( | IAudioStreamLoader * | loader | ) | `[pure virtual]`

Registers a new audio stream loader in the sound engine.

Use this to enhance the audio engine to support other or new file formats. To do this, implement your own IAudioStreamLoader interface and register it with this method

virtual void irrklang::ISoundEngine::removeAllSoundSources | ( |  | ) | `[pure virtual]`

Removes all sound sources from the engine.

This will also cause all sounds to be stopped. Removing sound sources is only necessary if you know you won't use a lot of non-streamed sounds again. Sound sources of streamed sounds do not cost a lot of memory.

virtual void irrklang::ISoundEngine::removeSoundSource | ( | const ik_c8 * | name | ) | `[pure virtual]`

Removes a sound source from the engine, freeing the memory it occupies.

This will also cause all currently playing sounds of this source to be stopped. Also note that if the source has been removed successfully, the value returned by getSoundSourceCount() will have been decreased by one. Removing sound sources is only necessary if you know you won't use a lot of non-streamed sounds again. Sound sources of streamed sounds do not cost a lot of memory.

virtual void irrklang::ISoundEngine::removeSoundSource | ( | ISoundSource * | source | ) | `[pure virtual]`

Removes a sound source from the engine, freeing the memory it occupies.

This will also cause all currently playing sounds of this source to be stopped. Also note that if the source has been removed successfully, the value returned by getSoundSourceCount() will have been decreased by one. Removing sound sources is only necessary if you know you won't use a lot of non-streamed sounds again. Sound sources of streamed sounds do not cost a lot of memory.

virtual void irrklang::ISoundEngine::setAllSoundsPaused | ( | bool | bPaused = `true` | ) | `[pure virtual]`

Pauses or unpauses all currently playing sounds.

virtual void irrklang::ISoundEngine::setDefault3DSoundMaxDistance | ( | ik_f32 | maxDistance | ) | `[pure virtual]`

Sets the default maximal distance for 3D sounds.

Changing this value is usually not necessary. Use setDefault3DSoundMinDistance() instead. Don't change this value if you don't know what you are doing: This value causes the sound to stop attenuating after it reaches the max distance. Most people think that this sets the volume of the sound to 0 after this distance, but this is not true. Only change the minimal distance (using for example setDefault3DSoundMinDistance()) to influence this. See ISound::setMaxDistance() for details about what the max distance is. It is also possible to influence this default value for every sound file using ISoundSource::setDefaultMaxDistance(). This method only influences the initial distance value of sounds. For changing the distance after the sound has been started to play, use ISound::setMinDistance() and ISound::setMaxDistance().

Parameters:

  | maxDistance | Default maximal distance for 3d sounds. The default value is 1000000000.0f.

virtual void irrklang::ISoundEngine::setDefault3DSoundMinDistance | ( | ik_f32 | minDistance | ) | `[pure virtual]`

Sets the default minimal distance for 3D sounds.

This value influences how loud a sound is heard based on its distance. See ISound::setMinDistance() for details about what the min distance is. It is also possible to influence this default value for every sound file using ISoundSource::setDefaultMinDistance(). This method only influences the initial distance value of sounds. For changing the distance after the sound has been started to play, use ISound::setMinDistance() and ISound::setMaxDistance().

Parameters:

  | minDistance | Default minimal distance for 3d sounds. The default value is 1.0f.

virtual void irrklang::ISoundEngine::setDopplerEffectParameters | ( | ik_f32 | dopplerFactor = `1.0f`,
|  | ik_f32 | distanceFactor = `1.0f` |
| ) |  |  | `[pure virtual]`

Sets parameters affecting the doppler effect.

Parameters:

  | dopplerFactor | is a value between 0 and 10 which multiplies the doppler effect. Default value is 1.0, which is the real world doppler effect, and 10.0f would be ten times the real world doppler effect.
  | distanceFactor | is the number of meters in a vector unit. The default value is 1.0. Doppler effects are calculated in meters per second, with this parameter, this can be changed, all velocities and positions are influenced by this. If the measurement should be in foot instead of meters, set this value to 0.3048f for example.

virtual void irrklang::ISoundEngine::setListenerPosition | ( | const vec3df & | pos,
|  | const vec3df & | lookdir,
|  | const vec3df & | velPerSecond = `vec3df(0, 0, 0)`,
|  | const vec3df & | upVector = `vec3df(0, 1, 0)` |
| ) |  |  | `[pure virtual]`

Sets the current listener 3d position.

When playing sounds in 3D, updating the position of the listener every frame should be done using this function.

Parameters:

  | pos | Position of the camera or listener.
  | lookdir | Direction vector where the camera or listener is looking into. If you have a camera position and a target 3d point where it is looking at, this would be cam->getTarget() - cam->getAbsolutePosition().
  | velPerSecond | The velocity per second describes the speed of the listener and is only needed for doppler effects.
  | upvector | Vector pointing 'up', so the engine can decide where is left and right. This vector is usually (0,1,0).

virtual bool irrklang::ISoundEngine::setMixedDataOutputReceiver | ( | ISoundMixedOutputReceiver * | receiver | ) | `[pure virtual]`

Sets the OutputMixedDataReceiver, so you can receive the pure mixed output audio data while it is being played.

This can be used to store the sound output as .wav file or for creating a Oscillograph or similar. This works only with software based audio drivers, that is ESOD_WIN_MM, ESOD_ALSA, and ESOD_CORE_AUDIO. Returns true if sucessful and fals if the current audio driver doesn't support this feature. Set this to null again once you don't need it anymore.

virtual void irrklang::ISoundEngine::setRolloffFactor | ( | ik_f32 | rolloff | ) | `[pure virtual]`

Sets a rolloff factor which influences the amount of attenuation that is applied to 3D sounds.

The rolloff factor can range from 0.0 to 10.0, where 0 is no rolloff. 1.0 is the default rolloff factor set, the value which we also experience in the real world. A value of 2 would mean twice the real-world rolloff.

virtual void irrklang::ISoundEngine::setSoundVolume | ( | ik_f32 | volume | ) | `[pure virtual]`

Sets master sound volume. This value is multiplied with all sounds played.

Parameters:

  | volume | 0 (silent) to 1.0f (full volume)

virtual void irrklang::ISoundEngine::stopAllSounds | ( |  | ) | `[pure virtual]`

Stops all currently playing sounds.

virtual void irrklang::ISoundEngine::stopAllSoundsOfSoundSource | ( | ISoundSource * | source | ) | `[pure virtual]`

Stops all sounds of a specific sound source.

virtual void irrklang::ISoundEngine::update | ( |  | ) | `[pure virtual]`

Updates the audio engine. This should be called several times per frame if irrKlang was started in single thread mode.

This updates the 3d positions of the sounds as well as their volumes, effects, streams and other stuff. Call this several times per frame (the more the better) if you specified irrKlang to run single threaded. Otherwise it is not necessary to use this method. This method is being called by the scene manager automaticly if you are using one, so you might want to ignore this.

The documentation for this class was generated from the following file:

- ik_ISoundEngine.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

| The irrKlang Engine Documentation © 2003-2018 by Nikolaus Gebhardt. Generated by Doxygen (1.6.1)