Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import javax.swing.JOptionPane;
- import java.lang.Runtime.*;
- import java.net.*;
- import java.io.IOException;
- import java.net.URL;
- import javax.sound.sampled.AudioFormat;
- import javax.sound.sampled.AudioInputStream;
- import javax.sound.sampled.AudioSystem;
- import javax.sound.sampled.Clip;
- import javax.sound.sampled.DataLine;
- import javax.sound.sampled.LineUnavailableException;
- import javax.sound.sampled.UnsupportedAudioFileException;
- import java.io.*;
- public class regulate {
- public static void main(String[] args) {
- System.out.println("Oppresors will be brought down low");
- playAudio();
- Runtime runtime = Runtime.getRuntime();
- runtime.gc();
- long memory = runtime.freeMemory();
- int buffer = (int)memory;
- String output = Integer.toString(buffer);
- JOptionPane.showMessageDialog(null, "Checking Memory of RAM", output, JOptionPane.INFORMATION_MESSAGE);
- }
- static void playAudio(){
- try {
- URL url = new URL("http://www.castemcompany.com/regulator.mp3");
- AudioInputStream stream = AudioSystem.getAudioInputStream(url);
- Clip clip = AudioSystem.getClip();
- clip.open(stream);
- clip.start();
- } catch(Exception ex) {
- System.out.println("Error with playing sound.");
- ex.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement