-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSound.java
More file actions
62 lines (33 loc) · 729 Bytes
/
Sound.java
File metadata and controls
62 lines (33 loc) · 729 Bytes
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package mu;
import java.io.*;
import sun.audio.*;
import javax.sound.sampled.*;
import javax.sound.*;
public class Sound{
public static void success()
{
try{
String songFile = "pika.wav";
InputStream in = new FileInputStream(songFile);
AudioStream a = new AudioStream(in);
AudioPlayer.player.start(a);
}
catch(Exception e)
{
System.out.println("sucess problem");
}
}
public static void failure()
{
try{
String songFile = "pika3.wav";
InputStream in = new FileInputStream(songFile);
AudioStream a = new AudioStream(in);
AudioPlayer.player.start(a);
}
catch(Exception e)
{
System.out.println("failure problem");
}
}
}