I was browsing the API, first off it looks awesome! I'm planning on using it for my project, however I didn't notice a way to stream the file contents from an InputStream versus supplying a file name. I'd like to do this because I package all of my resources into a single archive file and access them via streams. Is there a nice way to accomplish this?

All methods that take filenames have equivalent methods that take URLs. I don't remember if I updated the Javadocs to reflect this change. You should be able to accomplish what you are after using those. Additionally, I added methods for streaming raw audio data directly through a source, which could be used as a last resort if you couldn't do it with URLs for some reason. Just look at the source code for SoundSystem.java. If I ever have some free time, I'll update the Javadocs and the tutorial guides.

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

I've discovered that the latest release of LWJGL breaks the SoundSystem library, because they no longer support indirect buffers. I've already figured out a solution and I am in the process of implementing it. I've been really busy lately so it might be a couple of weeks before I'm ready to post an update.

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

Exception in thread "Thread-15" java.lang.InterruptedException: sleep interrupted at java.lang.Thread.sleep(Native Method) at com.sun.media.sound.AbstractPlayer.nClose(Native Method) at com.sun.media.sound.AbstractPlayer.implClose(Unknown Source) at com.sun.media.sound.MixerSynth.implClose(Unknown Source) at com.sun.media.sound.AbstractMidiDevice.doClose(Unknown Source) at com.sun.media.sound.AbstractMidiDevice.close(Unknown Source) at javax.sound.midi.MidiSystem.getSequencer(Unknown Source) at javax.sound.midi.MidiSystem.getSequencer(Unknown Source) at paulscode.sound.MidiChannel.getSequencer(MidiChannel.java:1177) at paulscode.sound.MidiChannel.init(MidiChannel.java:268) at paulscode.sound.MidiChannel.<init>(MidiChannel.java:256) at paulscode.sound.Library.loadMidi(Library.java:1284) at paulscode.sound.SoundSystem.CommandNewSource(SoundSystem.java:1691) at paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2226) at paulscode.sound.CommandThread.run(CommandThread.java:121)

Sorry for the delay on this, Hansdampf. I am finally getting around to working on this bug (things have been really busy between work, school, and my new son). Before I start digging around, please let me know the following things about your system (to at least give me a direction to start from):

Sorry for the delay on this, Hansdampf. I am finally getting around to working on this bug (things have been really busy between work, school, and my new son). Before I start digging around, please let me know the following things about your system (to at least give me a direction to start from):

I think I'll focus on this one, since it is the "least common denominator". First thing I'll try is to install that particular JVM / plugin on my test machine here to see if I can reproduce the problem. If that doesn't work, then I'll try and come up with some test cases for you to run to hopefully narrow down the possible causes.

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

Hmm. If the problem existed in all versions of Java HotSpot, I would give it a higher priority. But if it only happens in that one version, I'm a little reluctant to put a whole lot of effort into solving it, since that makes it look more like a JVM bug. I will play around with it some to see if there is any obvious fix. Otherwise I'd just say have the user update their JVM if they experience this problem.

Another question - you mentioned that the SoundSystemPlayerApplet didn't play MIDI or sound. This particular bug we are looking at here is specific to MIDI. Is there another problem with the other sounds?

I know there is an issue with another open-source JVM - the 64-bit OpenJDK Firefox plug-in, where the JavaSound Mixer is not implemented (requiring you to chose another Mixer). Users running this JVM do not hear any sound from the SoundSystemPlayerApplet when running the LibraryJavaSound plug-in. I'm wondering if this is also true for Java HotSpot. I guess I'll see for myself when I get HotSpot running on my test machine..

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

Not at all. SoundSystem has been extensively tested on numerous systems running Windows 7 32-bit on both IE and Firefox. That list is just the setups that I am running here at home on my own test machines. My point was that I am unable to replicate the problem on my test machines for debugging since I'm using that same version of Java from multiple OS's, browsers, and architectures.

Getting back to your problem, though, if I can't get MIDI to work (which seems likely based on the output, indicating an inability to acquire a Sequencer), at the very least I should still be able to catch that exception to allow SoundSystem to continue running. It would just mean that in the rare cases where this problem happens, users would just not be able to play MIDI.

Before I give up, though, let me research to see if there is another way I can acquire a Sequencer, which might eliminate that problem. My first thought is to catch the Exception and then immediately try again, since that Thread in question should be awake now.

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

I tried a couple of different things in this applet If an InterruptedException is caught when trying to grab the default Sequencer, it tries again. If that doesn't work, then it tries looking up one of the common Sequencers by name from the list of available MIDIDevices. Hopefully one of these things will work.

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

Awesome, nice work on the game! It runs beautifully for me on Ubuntu 64-bit, Sun Java 6 64-bit.

Let me know if any of your clients have a problem with the sound. The more people using the library, the more compatible I'll be able to make it.

One known issue with the LibraryJavaSound plug-in is no sound for users who are running one of the many open-source JRE's other than Sun Java (like OpenJDK which ships with Ubuntu 64-bit, for example). The cause of this is that the "Java Sound Mixer", which LibraryJavaSound relies on, is only available in Sun Java (which most users have, but a few might not). If anyone has this problem, they can download Sun Java for free from the Sun/Oracle website http://java.com/en/download/index.jsp, and that will correct the problem. I'm currently working on an intelligent method for choosing an appropriate Mixer from whatever is available if "Java Sound Mixer" is not found. This should hopefully make it so the LibraryJavaSound plug-in will work with other JREs besides Sun Java only. I'll post an update here if I can get this working properly.

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

I've been pleasantly surprised by the complete lack of any bugs. That or maybe players are confusing sound related bugs with all my regular bugs. I will certainly keep you up to date with any bugs we do come across, but so far it's been smooth sailing!cheers,don

That aught to work, unless there is a bug I need to fix. What happens when you run this code? Which library plug-in has the problem (or do they all)? If it is just not playing anything (no errors or exceptions), here are a couple of things you could try:1) Pass the stream an initial chunk of data or two before calling ss.play( "gen" )2) Try increasing the size of the data chunks

It would be nice if I could handle generated sounds like sounds loaded from a file. Is that possible?

Good point - I probably should add the ability to create a "normal source" from generated audio data (rather than streaming being the only way to deal with generated data). This should be a pretty simple addition. Is that what you are talking about, or did you have something else in mind?

We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer

Good point - I probably should add the ability to create a "normal source" from generated audio data (rather than streaming being the only way to deal with generated data). This should be a pretty simple addition. Is that what you are talking about, or did you have something else in mind?

Yes, exactly! That would be fantastic and I could ditch my own broken sound engine

I've just started with your sound system and I must admit, it looks great. The only problem I've struck so far is that I cannot adjust the volume on any MIDI tunes. The volume controls work for WAV files, but not MIDI. I'm using the JOAL plugin

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org