public void startSound() {
        if (!isPlaying) {
            isPlaying = true;
            bitNumber = new Random().nextInt(9);
            thread    = new Thread() {
                AudioFormat    af;
                SourceDataLine sdl;
                @Override
                public void run() {
                    super.run();    // To change body of generated methods, choose Tools | Templates.

                    try {

                        // TODO code application logic here
                        // byte[] buf = new byte[ 1 ];
                        af  = new AudioFormat((float) 16000, 8, 1, true, false);
                        sdl = AudioSystem.getSourceDataLine(af);
                        sdl = AudioSystem.getSourceDataLine(af);
                        System.out.print("1");
                        sdl.open(af);
                        System.out.print("2");
                        sdl.start();
                        System.out.print("3");

                        byte[] buffer = new byte[2];
                        int    t      = 0;

                        while (isPlaying) {
                            for (int i = 0; i < 100 * (float) 44100 / 1000; i++) {

                                // buffer[ 0 ] = (byte )(new Random().nextInt(255));
                                t = (t + 1) % (Integer.MAX_VALUE);
                                for (int j=0;j<buffer.length;j++) {
                                    buffer[j] = compose8bit(t);
                                }
                                sdl.write(buffer,0,buffer.length);

                                if (!isPlaying) {
                                    break;
                                }
                            }
                        }

                        System.out.print("4");
                        sdl.drain();
                        System.out.print("5");
                        sdl.stop();
                        System.out.print("6");
                        sdl.close();
                        System.out.print("7");
                    } catch (LineUnavailableException ex) {
                        Logger.getLogger(GameBoard.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
                @Override
                public void interrupt() {
                    super.interrupt();    // To change body of generated methods, choose Tools | Templates.
                }
            };
            thread.start();
        }
    }