DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Playing Midis

  1. #1
    Join Date
    Jul 2004
    Posts
    1

    Playing Midis

    Hi,

    I'm trying to get a MidiFile to play in a basic applet, but I can't hear the sound. I used the Game Tutorial on here for the code, but I'm not sure if it will work with .mid's as it said it was using .au

    Is there a special kind of object besides AudioClip that I need to make the Midi play? I've included my code just in case you need to look at it:
    Code:
    	Clip bgm;
    	
    	public void init() {
    		bgm = getAudioClip (getCodeBase(), "GS_stadium.au");
    	}
    	
    	public void run() {
    		bgm.play();
    	}

  2. #2
    Join Date
    Sep 2002
    Posts
    124
    Hmmm, you should be able to play midi, au, wav, aiff files no problem at all. You might like to try looking at the following page...

    http://java.sun.com/docs/books/tutor...und/index.html

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links