how to add sound effects to a Groovy / SwingBuilder application?
I've created a desktop application using Groovy and SwingBuil开发者_如何学Pythonder. I would like to add sound effects to my app. How can I do that ?
Thank you...
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.
精彩评论