public void run()	{
    	// Run continuously
    	for (;;)	{
    		// If the audio device is ready , the program wants to and we aren't already then
    		// get data from the audio device.
    		if ((audioReady==true)&&(loadingFile==false)&&(gettingAudio==false)) getSample();
    		else if (loadingFile==true) getFileData();
    		// Add the following so the thread doesn't eat all of the CPU time
    		else	{
    			try	{sleep(1);}
    			catch (Exception e)	{JOptionPane.showMessageDialog(null,"Error in run()\n"+e.toString(),"Rivet", JOptionPane.ERROR_MESSAGE);}
    			}
    		}
    }