> ..So, when I try to set up the same system
> that works fine in the "local" program in a javabean and invoke it via
> a .jsp page the server gets stuck on an infinite loop when executing
> the AudioSystem.getAudioFileFormat().
'infinite loop'? I think not.
Perhaps it is throwing an exception the code is ignoring.
<http://www.physci.org/codes/javafaq.jsp#stacktrace> [1]
>...But this only happens with some
> audio files but these same audio files works perfectly in the "local"
> program.
[ Which has access to the AudioFileFormats defined for the
local system. ]
<http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/sampled/AudioSystem.html#get
AudioFileFormat(java.io.File)>
..and throws..
[1]
<file:///F:/docs/api/javax/sound/sampled/UnsupportedAudioFileException.html>
> ..So my question is if anyone knows why this happends or if
> someone has a way of getting the length/duration of an audio file
> without using the getAudioFileFormat()?
To get the length of an audio file, you first need to have
the functionality to understand that format. I suspect that
the server simply does not understand the same wide range of
audio formats understood by your local system.
So, if that is the case here - No.
Andrew Thompson - 08 Nov 2005 16:17 GMT
> [ Which has access to the AudioFileFormats defined for the
> local system. ]
[quoted text clipped - 3 lines]
> [1]
> <file:///F:/docs/api/javax/sound/sampled/UnsupportedAudioFileException.html>
'That web page looks best on the monitor of my PC'
..dang I hate that. Anyway, translate that to a Sun
URL and you're in business.
rundbom@gmail.com - 08 Nov 2005 16:35 GMT
>'infinite loop'? I think not.
>Perhaps it is throwing an exception the code is ignoring.
Well, I don't know what else it could be. I catch both the
UnsupportedAudioFileException, the IOException and also a general
Exception and stacktraces them all just to be sure that it isn't the
"ignoring exception"-problem. And when the server gets to executing the
getAudioFileFormat() line it just stops responding and the cpu-usage
increases to 100%. Could it be something else than an infinite loop?
And the server and the test-program both runs on the same machine under
the same java version so I think it would be weird if the program
understands a file and not the server?
Andrew Thompson - 08 Nov 2005 17:06 GMT
>>'infinite loop'? I think not.
>>Perhaps it is throwing an exception the code is ignoring.
[quoted text clipped - 3 lines]
> Exception and stacktraces them all just to be sure that it isn't the
> "ignoring exception"-problem.
Dang.. my crystal ball is broke!
>...And when the server gets to executing the
> getAudioFileFormat() line it just stops responding and the cpu-usage
> increases to 100%. Could it be something else than an infinite loop?
?? Perhaps.. no this is not an area of specialty for me,
perhaps I better wait a bit for the sound gurus to have a
look at your problem..
Have you searched the bug database for anything similar?
<http://bugs.sun.com/bugdatabase/>