Playing Midis


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center