Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3 4 ... 8
  ignore  |  Print  
  3D Sound Engine  (Read 78513 times)
0 Members and 1 Guest are viewing this topic.
Offline newera31
« Reply #30 - Posted 2010-02-21 18:54:30 »

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?

Thank you,

Tony
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #31 - Posted 2010-02-25 23:40:40 »

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
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #32 - Posted 2010-02-26 00:35:00 »

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #33 - Posted 2010-03-10 00:40:19 »

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):

1) Operating System (XP, Vista, Ubuntu, etc) and architecture (32bit or 64bit)
2) Browser (IE, Firefox, etc) and architecture (32bit or 64bit)
3) JVM/Browser plugin (Sun, OpenJDK, etc), version, and architecture (32bit or 64bit)

We love death.  The US loves life.  That is the difference between us.  -Osama bin Laden, mass murderer
Offline gouessej
« Reply #34 - Posted 2010-03-19 14:45:58 »

What about the integration of your library into famous 3D engines? Ardor3D? JMonkeyEngine?

It still works fine in my game, thank you very much  Grin

Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #35 - Posted 2010-03-19 16:45:20 »

What about the integration of your library into famous 3D engines? Ardor3D? JMonkeyEngine?

Development has come to a crawl due to almost no free time, but that is still my goal at some point..

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

Senior Member


Projects: 3


too offending?


« Reply #36 - Posted 2010-03-19 17:42:39 »

Quote
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):

1) Operating System (XP, Vista, Ubuntu, etc) and architecture (32bit or 64bit)
2) Browser (IE, Firefox, etc) and architecture (32bit or 64bit)
3) JVM/Browser plugin (Sun, OpenJDK, etc), version, and architecture (32bit or 64bit)

oops, I was drunk that day you posted.

1) win7 32
2) FF 32 and IE
3) 1.6.0_18-b07 Java HotSpot(TM) Client VM  32

realtek high def., driver: 6.0.1.5953

lots of sillystupid games: http://www.emaggame.com
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #37 - Posted 2010-03-19 22:15:16 »

3) 1.6.0_18-b07 Java HotSpot(TM) Client VM  32
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
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #38 - Posted 2010-03-20 00:02:43 »

Yep, seems to be the Java version. I just tried with
1.6.0_16-b01
1.5.0_22-b03
and both work fine.

lots of sillystupid games: http://www.emaggame.com
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #39 - Posted 2010-03-20 00:52:10 »

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #40 - Posted 2010-03-20 01:10:57 »

The
> Exception in thread "Thread-15" java.lang.InterruptedException: sleep interrupted
is thrown directly after starting the applet, before I can try to play a sound or midi.
Quote
But if it only happens in that one version...
the installer says I have the latest JRE, so maybe it is a problem.
No problem for me, I don't use your engine yet.  Wink

lots of sillystupid games: http://www.emaggame.com
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #41 - Posted 2010-03-20 01:39:41 »

The
> Exception in thread "Thread-15" java.lang.InterruptedException: sleep interrupted
is thrown directly after starting the applet, before I can try to play a sound or midi
I meant for the versions that don't throw the exception - do both MIDI and sound work?

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

Senior Member


Medals: 11


Staff Sergeant


« Reply #42 - Posted 2010-03-20 01:59:37 »

Stupid question, but where does one download HotSpot (vs. plain old Sun Java that everyone normally uses)?  They aren't the same thing, right?

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

JGO Coder


Medals: 4



« Reply #43 - Posted 2010-03-20 03:18:11 »

Quote
They aren't the same thing, right?
Hotspot is Java's JIT. So they are the same thing.

Current project - Rename and Sort
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #44 - Posted 2010-03-20 03:29:09 »

Gotcha.  Well then I can't reproduce the problem here, since that is the same version I have installed on my test machines, and the applet runs fine for me in all of the following setups:

Windows XP 32-bit
    Internet Explorer
    Firefox

Windows Vista 32-bit
    Internet Explorer
    Firefox

Windows 7 64-bit
    Internet Explorer 32-bit
    Firefox 32-bit

Ubuntu 64-bit
    Firefox 64-bit  **(Unstable plug-in)
    Firefox 32-bit

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

Senior Member


Projects: 3


too offending?


« Reply #45 - Posted 2010-03-20 09:20:33 »

Then it can be a problem of win7 32 bit?  (my OS). It is not in your list.
Hard to imagine for me.
Good luck!
 

lots of sillystupid games: http://www.emaggame.com
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #46 - Posted 2010-03-20 10:15:24 »

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
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #47 - Posted 2010-03-20 18:44:09 »

Ok, here is my first test.  Could you please run this applet and copy the output?  Also let me know if it plays anything.

http://www.paulscode.com/source/MIDI/MIDIApplet/

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
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #48 - Posted 2010-03-20 19:26:02 »

midi plays fine (1.6.0_18-b07)

1  
2  
3  
4  
Using 'Real Time Sequencer' as the Sequencer.
The sequencer is NOT an instance of Synthesizer
Using 'Java Sound Synthesizer' as the Synthesizer.
Method 'getDefaultSoundbank()' returned 'null'.

lots of sillystupid games: http://www.emaggame.com
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #49 - Posted 2010-03-20 20:37:17 »

Awesome, I'll incorporate the changes into the SoundSystem.

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

Junior Member


Projects: 1



« Reply #50 - Posted 2010-05-30 16:41:27 »

I added your sound library to my game www.chippeddagger.com.  It works great!  Nice work Paul!
cheers,
don
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #51 - Posted 2010-05-30 18:24:32 »

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
Offline donmc

Junior Member


Projects: 1



« Reply #52 - Posted 2010-06-04 21:23:37 »

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.  persecutioncomplex  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
Offline appel

JGO Wizard


Medals: 50
Projects: 4


I always win!


« Reply #53 - Posted 2010-07-29 18:20:07 »

This looks great, exactly the kind of library I was looking for.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #54 - Posted 2010-07-29 18:27:15 »

I'm going to be implementing this very soon into my own game. Smiley

See my work:
OTC Software
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #55 - Posted 2010-07-30 09:08:53 »

One more happy user of your engine  Smiley

Could you tell me how I can use your engine with my procedurally generated sounds?
I went through the tutorial and had a look at the source code but I didn't get it working.

This is one of my tries:
1  
2  
3  
SoundSystem ss=new SoundSystem();
ss.rawDataStream(audioformat, false, "gen", 0,0,0,0,0);
ss.feedRawAudioData("gen",data);


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

lots of sillystupid games: http://www.emaggame.com
Offline paulscode

Senior Member


Medals: 11


Staff Sergeant


« Reply #56 - Posted 2010-07-30 11:37:09 »

Could you tell me how I can use your engine with my procedurally generated sounds?
I went through the tutorial and had a look at the source code but I didn't get it working.

This is one of my tries:
1  
2  
3  
SoundSystem ss=new SoundSystem();
ss.rawDataStream(audioformat, false, "gen", 0,0,0,0,0);
ss.feedRawAudioData("gen",data);

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

Let me know if either of these things help.


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
Offline Hansdampf

Senior Member


Projects: 3


too offending?


« Reply #57 - Posted 2010-07-30 12:05:29 »

I used LibraryJavaSound.class and adding
1  
ss.feedRawAudioData("gen", new byte[2]);
made it work.

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  Cheesy

lots of sillystupid games: http://www.emaggame.com
Offline gouessej
« Reply #58 - Posted 2010-07-30 12:59:13 »

One more happy user of your engine  Smiley
One user still happy of not having to write its own sound library  Grin I looked at some other attempts to wrap Java Sound API and there are more buggy and/or less documented.

Offline kaffiene
« Reply #59 - Posted 2010-08-09 02:47:07 »

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
Pages: 1 [2] 3 4 ... 8
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!