Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello all, when I try to make irrKlang play a sound using a relative path, for example like so:
...irrKlang complains, saying "Could not open sound file: bell.wav". If I specify the absolute path to the file, like:
... 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 |
||||
|
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. |
||||
|
erik, 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? |
||||
|
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. |
|