gouessej
|
 |
«
Reply #30 - Posted
2010-07-29 11:34:55 » |
|
Ah, I see. I'm thinking the best solution will be to try and create a SourceDataLine for each chosen Mixer, and check for compatibility based on static parameters that the user can change to fit their needs (things like range of sample-rates, required controls, etc). If none of the available Mixers are able to meet those parameters, the thrown SoundSystemException should indicate what the specific problem was. I'll start working on this concept when I get home this evening, and when its implemented, maybe I can have you beta-test it for me to make sure it works in your particular case.
It is a good idea, I agree with your conclusion. We should call Mixer.isLineSupported() with some very basic SourceDataLine instances using very common audio formats that should be supported even by the poorest implementation of Java Sound. Skipping explicitly the camera and JSAE in my case is still a useful step because when JSAE should not be used, isLineSupported returns true even though you use the audio format of a sample it is not able to play 
|
|
|
|
paulscode
|
 |
«
Reply #31 - Posted
2010-07-29 19:17:33 » |
|
isLineSupported returns true even though you use the audio format of a sample it is not able to play  In this case, do you know if the exception is thrown before the start() method is called? If it happens when the SourceDataLine/Clip is created or buffer is attached, it would be possible for me to create a test line to reveal the problem and handle it in my code. But if it doesn't happen until start() is called (or if no exception is thrown at all), I'm not sure of a better workaround than the one you are using.
|
We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer
|
|
|
gouessej
|
 |
«
Reply #32 - Posted
2010-07-30 09:21:08 » |
|
In this case, do you know if the exception is thrown before the start() method is called? If it happens when the SourceDataLine/Clip is created or buffer is attached, it would be possible for me to create a test line to reveal the problem and handle it in my code. But if it doesn't happen until start() is called (or if no exception is thrown at all), I'm not sure of a better workaround than the one you are using.
I remember that the attachment fails, it says "attachBuffer returns null" or something like that. I will send you the trace in 8 hours when I'm back home. I remember that there are already a lot of worrying messages displayed when creating a SoundSystem instance far before playing any sample.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
paulscode
|
 |
«
Reply #33 - Posted
2010-07-30 09:40:39 » |
|
I remember that the attachment fails, it says "attachBuffer returns null" or something like that. Excellent, then I should be able to test for the problem within the LibraryJavaSound plug-in, so you won't need that bug-fix any more.
|
We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer
|
|
|
gouessej
|
 |
«
Reply #34 - Posted
2010-07-30 10:56:42 » |
|
Excellent, then I should be able to test for the problem within the LibraryJavaSound plug-in, so you won't need that bug-fix any more.
It is really fine but I will have to write a bug report concerning the fact that Java Sound Audio Engine tries to use my microphone instead of using my sound card with a small test case (get the mixer, get a clip from it, play a basic sound). Can you provide me a very basic AU file?
|
|
|
|
gouessej
|
 |
«
Reply #35 - Posted
2010-07-30 17:30:08 » |
|
The stack trace is below: Error in class 'ChannelJava Sound' Unable to attach buffer to clip in method 'attachBuffer' ERROR MESSAGE: Audio Device Unavailable STACK TRACE: com.sun.media.sound.HeadspaceMixer.nResume(Native Method) com.sun.media.sound.HeadspaceMixer.implOpen(HeadspaceMixer.java:346) com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:286) com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:323) com.sun.media.sound.MixerClip.open(MixerClip.java:162) paulscode.sound.libraries.ChannelJavaSound.attachBuffer(ChannelJavaSound.java:276) paulscode.sound.libraries.SourceJavaSound.play(SourceJavaSound.java:298) paulscode.sound.Library.play(Library.java:587) paulscode.sound.Library.play(Library.java:556) paulscode.sound.SoundSystem.CommandPlay(SoundSystem.java:1892) paulscode.sound.SoundSystem.CommandQueue(SoundSystem.java:2388) paulscode.sound.CommandThread.run(CommandThread.java:121)
|
|
|
|
paulscode
|
 |
«
Reply #36 - Posted
2010-07-30 19:00:06 » |
|
Can you provide me a very basic AU file? Here, I converted one of the test sounds I use a lot for testing purposes: test.au
|
We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer
|
|
|
gouessej
|
 |
«
Reply #37 - Posted
2010-07-30 19:52:04 » |
|
Here, I converted one of the test sounds I use a lot for testing purposes: test.auThanks.
|
|
|
|
gouessej
|
 |
«
Reply #38 - Posted
2010-08-08 12:26:06 » |
|
I get this even though it works with my fix: Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' Buffer null in method 'attachBuffer' Error in class 'ChannelJava Sound' AudioFormat null in method 'resetStream' Error in class 'ChannelJava Sound' AudioFormat null in method 'resetStream' Error in class 'ChannelJava Sound' AudioFormat null in method 'resetStream' Error in class 'ChannelJava Sound' AudioFormat null in method 'resetStream' Error in class 'ChannelJava Sound' Pan control not supported Error in class 'ChannelJava Sound' Sample rate control not supported
|
|
|
|
paulscode
|
 |
«
Reply #39 - Posted
2010-08-08 23:55:18 » |
|
The first message about sample rate isn't much of a problem (unless you want to change the pitch or use the new Doppler effect).
The second message is somewhat problematic - 3D sound will not really be "3D" without a Pan control (volume differences between left and right speaker).
The other two messages are caused by a logic error in my code (I had assumed that all the channels are associated with sources, which of course rarely ever the case). This shouldn't effect functionality, just generate the annoying messages. I'll have this fixed in the next release.
|
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!
|
|
gouessej
|
 |
«
Reply #40 - Posted
2010-08-09 09:03:05 » |
|
The first message about sample rate isn't much of a problem (unless you want to change the pitch or use the new Doppler effect).
The second message is somewhat problematic - 3D sound will not really be "3D" without a Pan control (volume differences between left and right speaker).
The other two messages are caused by a logic error in my code (I had assumed that all the channels are associated with sources, which of course rarely ever the case). This shouldn't effect functionality, just generate the annoying messages. I'll have this fixed in the next release.
Let me know when it is ready  It will allow me to remove my crappy fix. Will your next release contain a fix for my problem with the webcam used instead of the sound card?
|
|
|
|
paulscode
|
 |
«
Reply #41 - Posted
2010-08-09 09:31:05 » |
|
Will your next release contain a fix for my problem with the webcam used instead of the sound card?
Yes it will. Sorry for the delay, I have trouble finding time for programming these days. The bug fixes are all done, but I still need to work out a thread synchronization problem that has surfaced related to the new stream-position checking stuff I've added. It shouldn't be too much longer.
|
We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer
|
|
|
gouessej
|
 |
«
Reply #42 - Posted
2010-08-10 10:19:52 » |
|
Sorry for the delay
Don't be sorry, you already do your best, thanks.
|
|
|
|
nsigma
|
 |
«
Reply #43 - Posted
2010-08-13 12:07:17 » |
|
The first message about sample rate isn't much of a problem (unless you want to change the pitch or use the new Doppler effect).
The second message is somewhat problematic - 3D sound will not really be "3D" without a Pan control (volume differences between left and right speaker).
Just back from holiday - this thread still going?!  You're probably aware of the JSResources site, but if not might want to check this link - http://www.jsresources.org/faq_audio.html#controls_of_dad_line Main point is that if you're picking one of the direct audio mixers(?), you probably won't ever get a Pan control, though you might get a Balance one.
|
Praxis LIVE - hybrid visual IDE for (live) creative coding
|
|
|
paulscode
|
 |
«
Reply #44 - Posted
2010-08-13 20:04:32 » |
|
Main point is that if you're picking one of the direct audio mixers(?), you probably won't ever get a Pan control I've noticed that as well. I am definitely going to try and write a single-line mixing algorithm of my own, which will solve all the "mixer headaches" that have been popping up. Once I have the formula, I might even be able to write a sound system for Android (could even use a 3D sound system, for example when stereo headphones are connected). That'll be my next goal after I get this version out the door (its looking more like later this weekend - been extra busy at work).
|
We love death. The US loves life. That is the difference between us. -Osama bin Laden, mass murderer
|
|
|
gouessej
|
 |
«
Reply #45 - Posted
2010-08-14 23:02:35 » |
|
I've noticed that as well. I am definitely going to try and write a single-line mixing algorithm of my own, which will solve all the "mixer headaches" that have been popping up. Once I have the formula, I might even be able to write a sound system for Android (could even use a 3D sound system, for example when stereo headphones are connected). That'll be my next goal after I get this version out the door (its looking more like later this weekend - been extra busy at work).
If you succeed, your sound library will become an excellent "candidate" to be integrated in 3D engines that support both J2SE and Android like Ardor3D, JME 3 and JPCT.
|
|
|
|
|