Strange Audio Problem

R

rundbom

I have this problem that seems to be very strange and I can't find a
solution to it. What I want to do is just to get the length (duration)
of an audio file. I do this by utilising
AudioSystem.getAudioFileFormat(). When I set up a test program that I
run directly from my computer this works fine. The problem is that I
want to use it in a JavaBean. 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(). But this only happens with some
audio files but these same audio files works perfectly in the "local"
program. 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()?
 
A

Andrew Thompson

..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.
...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...oSystem.html#getAudioFileFormat(java.io.File)>
...and throws..
[1]
..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.
 
R

rundbom

'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?
 
A

Andrew Thompson

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.

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/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top