-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBgm.java
44 lines (33 loc) · 1.19 KB
/
Bgm.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.FloatControl;
import java.io.File;
class Bgm implements Runnable
{
public void run(){
try{
AudioInputStream ais= AudioSystem.getAudioInputStream(new File("bg/Elden Ring Soundtrack OST - Godrick the Grafted (online-audio-converter.com).wav"));
Clip clip=AudioSystem.getClip();
clip.open(ais);
//
// FloatControl gainControl=(FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
//gainControl.setValue(-30.0f);
clip.start();
}catch (Exception e){
}
}
}
class Bgm1 implements Runnable{
public void run() {
try {
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("bg/3-03-a-hero-rises-strategymap.mp3"));
Clip clip = AudioSystem.getClip();
clip.open(audioInputStream);
// FloatControl gainControl=(FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
//gainControl.setValue(-30.0f);
clip.start();
} catch (Exception e) {
}
}
}