38 static int sound_id = 0;
46 m_soundsMap = std::map<int, irrklang::ISound*>();
51 std::string CSoundPlayer::getPathForFilename(
const char* filename) {
53 path.append(k_CSoundPlayer_SoundsFolderName);
55 path.append(filename);
62 irrklang::ISound* sound = m_engine->
play2D(getPathForFilename(filename).c_str(), play_looped, start_paused, track);
65 m_soundsMap.insert(std::pair<int, irrklang::ISound*>(sound_id, sound));
76 return m_soundsMap.at(
id);
Main header file of the irrKlang sound library, the only file needed to include.
virtual int play2D(const char *filename, bool play_looped=false, bool start_paused=false, bool track=false)
irrklang::ISound * getISound(int id)
IRRKLANG_API ISoundEngine *IRRKLANGCALLCONV createIrrKlangDevice(E_SOUND_OUTPUT_DRIVER driver=ESOD_AUTO_DETECT, int options=ESEO_DEFAULT_OPTIONS, const char *deviceID=0, const char *sdk_version_do_not_use=IRR_KLANG_VERSION)
Creates an irrKlang device. The irrKlang device is the root object for using the sound engine...
Represents a sound which is currently played.
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.
static std::string getProjectDirectory()