java - Loop a sound file from a certain point? -
suppose have sound file wish play in manner:
- start 0:00 mark.
- when sound file ends, replay 0:30.00 mark.
essentially, wish song play 0:00 0:30, loop 0:30 end.
how do this?
usually, when playing audio files, use audioclip.
audioclip audio = applet.newaudioclip( this.getclass().getresource( "..." ) ); audio.loop();
it's because of bad experiences loading audio file when project packed .jar file. if method recommend uses class, still more happy listen. however, if you've encountered same problem have , know how fix it, please tell me.
you might use clip
this, or if clip large, feed bytes directly sourcedataline
.
Comments
Post a Comment