public void setupAudio (WaveData waveData)	{
		  try {
			  // If the audio is already setup then close it
			  if (audioReady==true)	{
				  closeAudio(); 
				  return;
			  }
			  sampleCounter=0;
			  // If it is running stop the audio so it can be changed
			  audioMixer.stopAudio();
			  // Sample according to the the WaveData objects parameters
			  AudioFormat format=new AudioFormat((int)waveData.getSampleRate(),waveData.getSampleSizeInBits(),waveData.getChannels(),true,waveData.isEndian());
			  audioMixer.setAudioFormat(format);
			  //audioMixer.setDefaultLine();
			  // Handle any errors changing the mixer
			  if (audioMixer.openLine()==false)	{
				  String err=audioMixer.getErrorMsg();
				  JOptionPane.showMessageDialog(null,err,"Rivet",JOptionPane.ERROR_MESSAGE);
				  return;
			  }
			  audioMixer.line.start();
			  audioReady=true;
			  loadingFile=false;
		  } catch (Exception e) {
			  String err="Fatal error in setupAudio()\n"+e.getMessage();
			  JOptionPane.showMessageDialog(null,err,"Rivet",JOptionPane.ERROR_MESSAGE);
			  System.exit(0);
	   		}
     }