URL generation in SampleLoader

I changed this method in com.jme.sound.openAL.objects.util.SampleLoader…


    public static Buffer loadBuffer(String file) {
        try {
            URL url = new URL("file:" + file);
            return loadBuffer(url);
        } catch (MalformedURLException e) {
            LoggingSystem.getLogger().log(Level.WARNING,
                    "Could not load: " + file);
            return null;
        }
    }



...to look like this...

   public static Buffer loadBuffer(String file) {
//      try {
//         URL url = new URL("file:" + file);
         URL url = SampleLoader.class.getClassLoader().getResource(file);
         return loadBuffer(url);
//      } catch (MalformedURLException e) {
//         LoggingSystem.getLogger().log(Level.WARNING,
//               "Could not load: " + file);
//         return null;
//      }
   }



...so that sounds are loaded the same way as other stuff in jME.

Patch generated with Eclipse can be found here.

BTW: I like the new SoundSystem very much - very easy to use! Keep it up Arman :)

Actually, I think it would be better if SoundSystem.create3DSample() simply took a URL. That way one would be able to load files from both the relative file path and from jar files. Pretty please Arman…