aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Getting audio to play in the background of my GUI. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting audio to play in the background of my GUI." Watch "Getting audio to play in the background of my GUI." New topic
Author

Getting audio to play in the background of my GUI.

GregK
Greenhorn

Joined: Oct 24, 2005
Posts: 15
Hi

I'd like to be able to play audio in the background of my GUI using a JFRAME, is this possible?

I just want to load one audio file and have another play upon certain actions. I don't want audio to be selectable or anything I just want it to play as the GUI runs.

If anyone could start me off onwhere to look or give me a code snippet to get me going I'd really appreciate it. I've looked around abit and can't really find much.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

This article from OnJava might help you out a bit. And BTW, I found it as well as many others with a simple google search using Java Swing play wav file.
[ March 31, 2006: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
GregK
Greenhorn

Joined: Oct 24, 2005
Posts: 15
I'm still having loads of trouble with this.

I'm trying to embed ONE audiofile into my gui to load on startup as the gui is initialised. I've tried an AudioClip interface method using the getDocumentBase() method when loading the sounds but I get an error saying 'cannot find symbol - getDocumentBase'

I've tried another way using the following code -

Inside my gui, don't get any errors but nothing happens when i call the method.

Can someone help me?
[ April 05, 2006: Message edited by: Gregory Kodikara ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting audio to play in the background of my GUI.