How to play an audio file continuously in java? -
i making small program needs play file continuously. following code wrote play file once, not aware how continuously. please.
public class tanpuraaudio { audiostream = null; string filename = "c://s.wav"; inputstream in = null; public void play() throws ioexception, interruptedexception { try { in = new fileinputstream(filename); } catch (filenotfoundexception e) { system.out.println("media file not present in c drive."); } try { = new audiostream(in); } catch (ioexception e) { } audioplayer.player.start(as); } public void stop() throws ioexception, interruptedexception { audioplayer.player.stop(as); } }
you may looking clip.loop_continuously
, illustrated in playing clip.
Comments
Post a Comment