开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜