-
Notifications
You must be signed in to change notification settings - Fork 0
/
startBGMusic.java
34 lines (25 loc) · 1.02 KB
/
startBGMusic.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
import java.io.*;
import sun.audio.*;
public class startBGMusic
{
public void playMusic() throws Exception
{
String gongFile = "/C:/Users/Menon/Desktop/HospitalManagementSystem-20171023T060621Z-001/HospitalManagementSystem/HospitalManagementSystem/29302001.wav";
InputStream in = new FileInputStream(gongFile);
// create an audiostream from the inputstream
AudioStream audioStream = new AudioStream(in);
// play the audio clip with the audioplayer class
AudioPlayer.player.start(audioStream);
}
/* public static void main(String[] args)
throws Exception
{
// open the sound file as a Java input stream
String gongFile = "/C:/Users/Akhil/Downloads/HospitalManagementSystem/HospitalManagementSystem/29302001.wav";
InputStream in = new FileInputStream(gongFile);
// create an audiostream from the inputstream
AudioStream audioStream = new AudioStream(in);
// play the audio clip with the audioplayer class
AudioPlayer.player.start(audioStream);
}*/
}