Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - metapod

Pages: [1]
1
Other Support / Re: SoundSystem playbackgroundmusic null pointer
« on: January 31, 2014, 05:09:17 PM »
Although I'm not sure why it thinks LibraryJavaSound is not compatible, how do you add the native path for that?

2
Other Support / Re: SoundSystem playbackgroundmusic null pointer
« on: January 31, 2014, 04:59:17 PM »
Never mind I was missing some of the needed native files (.dll's in my case)!

3
Other Support / Re: SoundSystem playbackgroundmusic null pointer
« on: January 31, 2014, 03:56:42 PM »
If I skip the check and try to just construct it this happens...

Starting up SoundSystem...
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.openal.AL
   at paulscode.sound.libraries.LibraryLWJGLOpenAL.init(LibraryLWJGLOpenAL.java:164)
   at paulscode.sound.SoundSystem.CommandNewLibrary(SoundSystem.java:1576)
   at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2572)
   at paulscode.sound.CommandThread.run(CommandThread.java:121)
Initializing LWJGL OpenAL
    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

(I'm really not trying to be lazy by asking questions, I just keep getting stuck! I appreciate the feedback though.)

4
Other Support / Re: SoundSystem playbackgroundmusic null pointer
« on: January 31, 2014, 02:00:18 PM »
Oh wow, I'm an idiot... guess that's what happens when you're copy pasting examples not paying enough attention. I'm also not really used to Java and newing up everything (I normally do embedded C++).

Well I have a new problem when checking if LibraryLWJGLOpenAL is compatible I get:
 
Checking if LWJGL OpenAL is compatible...
Error in class 'SoundSystemConfig'
    InvocationTargetException thrown while attempting to invoke method 'Library.getTitle' in method 'getLibraryTitle'
Error in class 'SoundSystemConfig'
    Method 'Library.libraryCompatible' returned 'null' in method 'libraryCompatible'
    ...no

Checking if Java Sound is compatible...
    ...no

It seems really strange that Java Sound wouldn't be compatible either... because it works when I add it in the SoundSystem c'tor.

I added in all the lwjgl libs too (I think), I have:
AppleJavaExtensions.jar
asm-debug-all.jar
CodecJOrbis.jar
CodevWav.jar
jinput.jar
LibraryJavaSound.jar
LibraryLWJGLOpenAL.jar
lwjgl_test.jar
lwjgl_util_applet.jar
lwjgl_util.jar
lwjgl-debug.jar
lwjgl.jar
lzma.jar
SoundSystem.jar

Code: [Select]
    boolean aLCompatible = SoundSystem.libraryCompatible( LibraryLWJGLOpenAL.class );
    boolean jSCompatible = SoundSystem.libraryCompatible( LibraryJavaSound.class );

5
Other Support / SoundSystem playbackgroundmusic null pointer
« on: January 31, 2014, 11:05:13 AM »
I'm having a hard time getting started with soundsystem playing an ogg background music file...

Any idea why calling playBGM gives me a null pointer? The file DOES exist. Thanks!

Code: [Select]
public class SoundPlayer {
 
  private SoundSystem soundSystem;
  public static final String BGM = "BGM";
 
  public SoundPlayer() {
    try {
      SoundSystemConfig.addLibrary(LibraryJavaSound.class);
      SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
      SoundSystemConfig.setCodec("wav", CodecWav.class);
    }
    catch(SoundSystemException e)
    {
      System.err.println("error linking with the plug-ins" );
    }
   
    SoundSystem soundSystem = new SoundSystem();
   
    soundSystem.setMasterVolume(1.0f);
    soundSystem.setVolume(BGM, 1.0f);
  }
 
  public void playBGM(String name) {
    File f = new File("res/music/" + name);
    if (!f.exists()) return;

    try {
      URL path = f.toURI().toURL();
      System.out.println(path);
     
      soundSystem.backgroundMusic(BGM, path, name, true);
      soundSystem.setVolume(BGM, 1.0f);
    } catch (MalformedURLException e) {

      e.printStackTrace();
    }
  }
}

Pages: [1]