@Override
            public void run()
            {
                try
                {
                        sourceDataLine.open(audioFormat);
                        sourceDataLine.start();

                        //while there are dates to execute and stop == false
                        int count = 0;
                        while( count != -1 && stop == false)
                        {
                                if( pause == false )
                                    count = audioInputStream.read(tempBuffer,0,tempBuffer.length);
                                else
                                    count = 0;

                                //If there are dates to execute
                                if(count > 0 )
                                {
                                    if (volumeChanged)
                                    {
                                            FloatControl volControl = (FloatControl) sourceDataLine.getControl(FloatControl.Type.MASTER_GAIN);
                                            volControl.setValue(volume);
                                            volumeChanged = false;
                                    }
                                    sourceDataLine.write(tempBuffer, 0, count);
                                }
                        }
                        
                        sourceDataLine.drain();
                        sourceDataLine.close();                       

                        if (loop && stop == false)
                        {
                            load(fileName);
                            setVolume(volume);
                            song = new Song();
                            song.start();
                        }
                        
                        stop = false;
                        song = null;
                }
                catch (Exception e)
                {
                        e.printStackTrace();
                }
            }