Hello Guest

FSOUND_Sample_Load Filepath?

  • 3 Replies
  • 22938 Views
FSOUND_Sample_Load Filepath?
« on: May 24, 2007, 01:29:53 »
Hello.

I'm trying to load and play a sample using fmod, which I tell to

      
Code: [Select]
FSoundSample mod = FSound.FSOUND_Sample_Load(FSound.FSOUND_FREE, "back.mp3", FSound.FSOUND_LOOP_OFF, 0, 0);
    FSound.FSOUND_PlaySound(FSound.FSOUND_FREE, mod);

The Debugger stops at the second Line with a NullPointerException, probably because the file can't be found.

I'm using this inside an eclipse-rcp-application and wonder where the root of Filepath is in this context?
Putting the mp3 next to lwjgl.jar, the lwjgl-fmod3.jar or the dlls did not succeed, the root of the project also did not work! I even tried the bin-directory of the jre...

Any suggestions?

Greetings

*

Offline Matzon

  • *****
  • 2242
Re: FSOUND_Sample_Load Filepath?
« Reply #1 on: May 24, 2007, 08:31:54 »
I am not sure where the relative path is - try doing an absolute first to confirm everything works - and then guess the eclipse path.
I do not recommend using mp3 though. Consider using ogg/vorbis instead

Re: FSOUND_Sample_Load Filepath?
« Reply #2 on: May 24, 2007, 19:45:06 »
Thank you very very much!

I just returned from a very long day and can now enjoy a working background-music,
wondering why I not even thought about this most probable answer (elicpse dir) - it's so nice: thank you again!  ;D

Concerning an absolute path: I tried this before but must have missed the correct notation for windows driveletters and slashes
so if 'back.ogg' would lie on drive d: in the folder 'audio', which one would be correct in this context:

a) "D:audio\back.ogg"
b) "D:\audio\back.ogg"
c) "D:\\audio\back.ogg"

...I even read about four slashes somewhere, so

d) "D:\\\\audio\back.ogg"?

Perhaps slashes the other way round?

The 'ogg-advice' also hit very well which easily convinces me to say again: Thank you!

*

Offline Matzon

  • *****
  • 2242
Re: FSOUND_Sample_Load Filepath?
« Reply #3 on: May 24, 2007, 20:09:14 »
think its: file:///c:/