tags:

views:

8

answers:

1

I've created a desktop application using Groovy and SwingBuilder. I would like to add sound effects to my app. How can I do that ?

Thank you...

+1  A: 

There is nothing specific in groovy that you could use to add sound effect. Instead just use the existing Java libraries like this:

import  sun.audio.*;
import  java.io.*;

AudioStream as = new AudioStream(new FileInputStream(Filename));         
AudioPlayer.player.start(as);            

Encapsulate this code in a separate class and call it from your groovy application.

mfloryan