Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Relative path not working?

bongmatser420
Registered User
Quote
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


erik
Registered User
Quote
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.


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

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?


niko
Moderator
Quote
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: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






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