// Test of the Melody class

import java.net.*;
import java.io.*;
import sun.audio.*;

public final class melodyTest extends java.applet.Applet
{
	Melody mel;
	URL u;
		
	public void init()
	{
		 // Create a URL pointing to a melody data file
		try
		{
			u=new URL(getCodeBase(),"daisy.txt");
		}
		catch(Exception e) {}

		// Send it as input to the Melody class constructor
		mel=new Melody(u);
		
		// Convert the object array "rawAudio" to an AudioDataStream
		mel.soundStream=new AudioDataStream(new AudioData(mel.rawAudio));
		
		// Play it
		AudioPlayer.player.start(mel.soundStream);
	}
}
