Results 1 to 6 of 6
- 01-15-2009, 10:18 PM #1
[SOLVED] Resource limit in jars? Sound problems.
Hi, I'm currently writing applets using digital filtering techniques. The problem I have is that the sound files I'm using are truncated when viewing the applet online. When viewed using appletviewer they are the correct length. I'm using getResourceAsStream() to load the sound data. Is there a size limit on resources you load from jars or is something else going on?
Thanks.
I can't post links as my post count is too low, so rather than spam with pointless posts i'll do this: Examples are at the following address
www dot srcf dot ucam dot org slash ~jmh205 slash partIIproj
- 01-17-2009, 05:22 PM #2
elsewhere,....
I think it is somewhere else:
Spellex SDK for Java(TM) support
I saw something recently which gives me cause for pause whenever data transmission block goes over 4k minus control header space,... rioutine traffic on any given minute of internet activity streams copiously in excess of what I would think your DSP project would likely use. Third Light has "Online Galleries Of Your Pictures" so it would not be them. At SCRF it's no news is good news, so ( I guess ) let's see some code.
dot jar files and ....
we see things like this all the time:
So I would start by going back to scratch zero and placing File.write( various data values in your program at random points around the trouble area ) which is what all the experiences coders do in this situation..Java Code:/* Workaround for bug 4155072. The shared double buffer image * may hang on to a reference to this applet; unfortunately * Image.getGraphics() will continue to call JApplet.getForeground() * and getBackground() even after this applet has been destroyed. * So we ensure that these properties are non-null here. */
Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 01-17-2009, 06:36 PM #3
Here's the relevant code in Prototype2:
Loading:
Playing:Java Code:public void run() { try { InputStream is = Applet.class.getResourceAsStream("test.wav"); AudioInputStream in = AudioSystem.getAudioInputStream(is); if (!in.getFormat().matches(format)) { throw new IOException("Audio data is not in the correct format."); } if (in.getFrameLength() > Integer.MAX_VALUE) { throw new IOException("Audio data is too long."); } soundClip = new byte[(int)in.getFrameLength() * format.getFrameSize()]; in.read(soundClip, 0, soundClip.length); in.close(); playButton.setEnabled(true); } catch (IOException e) { System.err.println("I/O error: " + e.getMessage()); } catch (UnsupportedAudioFileException e) { System.err.println("I/O error: " + e.getMessage()); } }
Java Code:public void run() { line.start(); for (int i=0; i<soundClip.length; i+=bufsize) { line.write(soundClip, i, bufsize); } line.close(); }Last edited by OrangeDog; 05-14-2009 at 12:52 AM.
- 01-17-2009, 06:38 PM #4
Is there a workaround/fix or do I just have to use smaller input files?
- 01-17-2009, 11:26 PM #5
Wait for Hardwired or Fubarable ...
Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 01-22-2009, 09:20 PM #6
Similar Threads
-
More efficient in memory? Multiple Jars or Single Jars with lot's of Classes
By dark_cybernetics in forum New To JavaReplies: 0Last Post: 08-19-2008, 04:44 PM -
[SOLVED] what is text limit line?
By Nicholas Jordan in forum NetBeansReplies: 12Last Post: 07-16-2008, 05:05 AM -
Implement a simple splitter with a 20 pixel limit
By Java Tip in forum SWTReplies: 0Last Post: 07-11-2008, 04:43 PM -
PM Inbox Limit Increased
By JavaBean in forum Suggestions & FeedbackReplies: 7Last Post: 01-17-2008, 08:48 PM -
Limit of String
By javaplus in forum New To JavaReplies: 5Last Post: 11-19-2007, 04:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks