Results 1 to 4 of 4

Thread: sound editing

  1. #1
    nikkka is offline Member
    Join Date
    Mar 2011
    Posts
    45
    Rep Power
    0

    Default sound editing

    i want a file a.wav to run EXACTLY (without any sensible delay) after running a i.wav file. but there is a delay. what should i do?
    Java Code:
            Clip clip = (Clip) AudioSystem.getLine(info);
            clip.open(i);
            clip.start();
            clip.close();
            clip.open(a);
            clip.start();

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by nikkka View Post
    i want a file a.wav to run EXACTLY (without any sensible delay) after running a i.wav file. but there is a delay. what should i do?
    Java Code:
            Clip clip = (Clip) AudioSystem.getLine(info);
            clip.open(i);
            clip.start();
            clip.close();
            clip.open(a);
            clip.start();
    Are you using files to open your clip? If so, opening and reading data from a file takes some time. Better preload the data from your files and use ByteArrayInputStreams to open your clips; that gets rid of all the delays inherently present when reading from files. The delay finds its origin in your OS, not actually in your Java code.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    ivlatt is offline Member
    Join Date
    Apr 2011
    Posts
    12
    Rep Power
    0

    Default

    Quote Originally Posted by fghi932 View Post
    <Moderator Edit: spam quote deleted>
    What on earth...?
    Last edited by Fubarable; 04-16-2011 at 11:16 AM.

  4. #4
    runedog48 is offline Member
    Join Date
    Mar 2011
    Posts
    8
    Rep Power
    0

    Default

    Quote Originally Posted by nikkka View Post
    i want a file a.wav to run EXACTLY (without any sensible delay) after running a i.wav file. but there is a delay. what should i do?
    Java Code:
            Clip clip = (Clip) AudioSystem.getLine(info);
            clip.open(i);
            clip.start();
            clip.close();
            clip.open(a);
            clip.start();
    How long is the clip?

    try

    Java Code:
            
    
    //pre-load
    Clip clip = (Clip) AudioSystem.getLine(info);
            
    
    clip.open(i);
            clip.start();
    //waiting for how long the clip is?
            clip.close();
            clip.open(a);
            clip.start();
    //waiting for how long the clip is again?
            clip.close();
    //etc?
    Last edited by runedog48; 04-14-2011 at 02:38 PM.

Similar Threads

  1. Problem with editing jar
    By DanielR in forum New To Java
    Replies: 16
    Last Post: 02-11-2011, 02:15 AM
  2. Photo Editing
    By stekun in forum Advanced Java
    Replies: 3
    Last Post: 02-23-2010, 05:11 AM
  3. Text editing
    By right2001 in forum New To Java
    Replies: 1
    Last Post: 04-10-2009, 07:03 AM
  4. jTable Cell editing
    By mahaling_m in forum AWT / Swing
    Replies: 0
    Last Post: 06-23-2008, 08:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •