File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Sound in applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sound in applications" Watch "Sound in applications" New topic

Sound in applications

Jon Mattson

Joined: Feb 07, 2006
Posts: 19
I'm wondering how to make a midi file loop in a application.
I managed to make a file play once like a month ago, i took some code from some example and got it to work somehow.

Here are some lines from that code:

I would like to get it so that i can from my game loop change the file being played. Any ideas? :roll:
Shyam Prasad Murarka
Ranch Hand

Joined: May 02, 2005
Posts: 209
Dear Reader,
Well, while going through the Java API for AudioClip I saw this simple method:

Well, so just call this method on an AudioClip instance.

With Best Regards,
Shyam Prasad Murarka
Jon Mattson

Joined: Feb 07, 2006
Posts: 19
Well actually AudioClip loopClip; and SoundList soundList; wasn't supposed to be there. I first tried using them at first but I didn't succeed. Like how do you load the audio file to that AudioClip? AudioClip is an interface so how am i supposed to use it? There are like 10 classes that start with Audio in the API but i don't really get how to use them.
I agree. Here's the link:
subject: Sound in applications
It's not a secret anymore!