Wie in der Überschrift beschrieben, möchte ich einen Sound (ca 5 min) abspielen und an bestimmten stellen stoppen. Gibt es dazu einen Weg? Danke
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
public static void main(String[] args) {
while (end==false){
try{
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("K:/sound.wav"));
AudioFormat af = audioInputStream.getFormat();
int size = (int) (af.getFrameSize() * audioInputStream.getFrameLength());
byte[] audio = new byte[size];
DataLine.Info info = new DataLine.Info(Clip.class, af, size);
audioInputStream.read(audio, 0, size);
// for(int i=0; i < 32; i++) {
Clip clip = (Clip) AudioSystem.getLine(info);
clip.open(af, audio, 0, size);
clip.start();
// }
}catch(Exception e){ e.printStackTrace(); }
}
}