Advertisement
Guest User

Untitled

a guest
Mar 11th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. private void prepareAudio() {
  2. try {
  3.  
  4. InputStream is = getClass().getClassLoader().getResourceAsStream("beep.wav");
  5. InputStream buffer = new BufferedInputStream(is);
  6. inputStream = AudioSystem.getAudioInputStream(buffer);
  7. clip = AudioSystem.getClip();
  8. clip.open(inputStream);
  9.  
  10. } catch (Exception ex) {
  11. ex.printStackTrace();
  12. JOptionPane.showMessageDialog(null, "Houve um problema a preparar o audio do programa!");
  13. }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement