Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Strange Audio Problem

Thread view: 
rundbom@gmail.com - 08 Nov 2005 15:20 GMT
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()?
Andrew Thompson - 08 Nov 2005 16:15 GMT
> ..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/>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.