5 #ifndef __I_IRRKLANG_SOUND_ENGINE_H_INCLUDED__
6 #define __I_IRRKLANG_SOUND_ENGINE_H_INCLUDED__
19 class IAudioStreamLoader;
20 struct SInternalAudioInterface;
57 bool playLooped =
false,
58 bool startPaused =
false,
61 bool enableSoundEffects =
false) = 0;
85 bool playLooped =
false,
86 bool startPaused =
false,
88 bool enableSoundEffects =
false) = 0;
114 bool playLooped =
false,
115 bool startPaused =
false,
118 bool enableSoundEffects =
false) = 0;
143 bool playLooped =
false,
144 bool startPaused =
false,
146 bool enableSoundEffects =
false) = 0;
191 bool preload=
false) = 0;
213 bool copyMemory=
true) = 0;
231 bool copyMemory=
true) = 0;
296 virtual void update() = 0;
virtual void stopAllSounds()=0
Stops all currently playing sounds.
a 3d vector template class for representing vectors and points in 3d
virtual void setSoundVolume(ik_f32 volume)=0
Sets master sound volume. This value is multiplied with all sounds played.
virtual ik_f32 getDefault3DSoundMinDistance()=0
Returns the default minimal distance for 3D sounds.
virtual bool isMultiThreaded() const =0
Returns if irrKlang is running in the same thread as the application or is using multithreading.
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.
Base class of most objects of the irrKlang.
virtual bool setMixedDataOutputReceiver(ISoundMixedOutputReceiver *receiver)=0
Sets the OutputMixedDataReceiver, so you can receive the pure mixed output audio data while it is bei...
virtual void update()=0
Updates the audio engine. This should be called several times per frame if irrKlang was started in si...
virtual void registerAudioStreamLoader(IAudioStreamLoader *loader)=0
Registers a new audio stream loader in the sound engine.
virtual void setRolloffFactor(ik_f32 rolloff)=0
Sets a rolloff factor which influences the amount of attenuation that is applied to 3D sounds...
unsigned int ik_u32
32 bit unsigned variable.
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 ...
virtual const SInternalAudioInterface & getInternalAudioInterface()=0
Returns a pointer to internal sound engine pointers, like the DirectSound interface.
signed int ik_s32
32 bit signed variable.
Class which is able to create an audio file stream from a file.
char ik_c8
8 bit character variable.
virtual ik_f32 getSoundVolume()=0
Returns master sound volume.
Represents a sound which is currently played.
Everything in the irrKlang Sound Engine can be found in this namespace.
E_STREAM_MODE
An enumeration for all types of supported stream modes.
void * pIDirectSound8
IDirectSound8 interface, this is not null when using the ESOD_DIRECT_SOUND8 audio driver...
A sound source describes an input file (.ogg, .mp3, .wav or similar) and its default settings...
Autodetects the best stream mode for a specified audio data.
vec3d< ik_f32 > vec3df
Typedef for a ik_f32 3d vector, a vector using floats for X, Y and Z.
void * pWinMM_HWaveOut
HWaveout interface, this is not null when using the ESOD_WIN_MM audio driver.
virtual void setDefault3DSoundMinDistance(ik_f32 minDistance)=0
Sets the default minimal distance for 3D sounds.
Interface to overwrite file access in irrKlang.
void * pALSA_SND_PCM
ALSA PCM Handle interface, this is not null when using the ESOD_ALSA audio driver.
virtual void setDefault3DSoundMaxDistance(ik_f32 maxDistance)=0
Sets the default maximal distance for 3D sounds.
virtual const char * getDriverName()=0
returns the name of the sound driver, like 'ALSA' for the alsa device
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 ik_s32 getSoundSourceCount()=0
Returns amount of loaded sound sources.
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 diff...
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.
float ik_f32
32 bit floating point variable.
Interface to be implemented by the user, which recieves the mixed output when it it played by the sou...
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 bool loadPlugins(const ik_c8 *path)=0
Loads irrKlang plugins from a custom path.
virtual void setAllSoundsPaused(bool bPaused=true)=0
Pauses or unpauses all currently playing sounds.
virtual void removeAllSoundSources()=0
Removes all sound sources from the engine.
virtual void setDopplerEffectParameters(ik_f32 dopplerFactor=1.0f, ik_f32 distanceFactor=1.0f)=0
Sets parameters affecting the doppler effect.
ik_u32 pCoreAudioDeciceID
AudioDeviceID handle, this is not null when using the ESOD_CORE_AUDIO audio driver.
virtual bool isCurrentlyPlaying(const char *soundName)=0
Returns if a sound with the specified name is currently playing.
virtual void addFileFactory(IFileFactory *fileFactory)=0
Adds a file factory to the sound engine, making it possible to override file access of the sound engi...
structure for returning pointers to the internal audio interface.
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 ik_f32 getDefault3DSoundMaxDistance()=0
Returns the default maximal distance for 3D sounds.
void * pIDirectSound
IDirectSound interface, this is not null when using the ESOD_DIRECT_SOUND audio driver.
Interface to the sound engine, for playing 3d and 2d sound and music.
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 void removeSoundSource(ISoundSource *source)=0
Removes a sound source from the engine, freeing the memory it occupies.