Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Relative path not working?

Registered User
2013-07-22 02:21:12

Hello all,

when I try to make irrKlang play a sound using a relative path, for example like so:

engine->play2D("bell.wav", false);

...irrKlang complains, saying "Could not open sound file: bell.wav". If I specify the absolute path to the file, like:

engine->play2D("C:/projects/irrklangtest/bell.wav", false);

... then irrKlang will play the sound. I don't understand why the relative path does not work when the absolute path does? I'm using codeblocks, and have placed a copy of bell.wav in both the root folder of the project, and also in the folder that's used as a working directory when the project is compiled and run. I don't understand where irrKlang is actually looking such that it cannot see this file?

Thanks for any help

Registered User
2013-07-22 16:34:00

Probably your app or the working directory of the app isn't in the one where your sound is. irrKlang is looking in your working directory.

Registered User
2013-07-23 14:26:50


Thanks for your reply. How can I determine what irrKlang considers the working directory to be? All other libraries I've used consider the working directory to be where the application's binary resides, but apparently irrKlang does things differently?

2013-07-24 07:00:30

No irrklang does it the same as any other library. You can get the current working directory on windows using _getcwd() and on unix using getcwd(), and see if this is the current one you are thinking.

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Interna?ional" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact