package hypernova;

import javax.swing.JFrame;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;

import hypernova.gui.Viewer;

public class Hypernova {
    public static final String TITLE = "Hypernova";

    public static Universe universe;
    private static Viewer viewer;

    public static boolean debug = false;
    private static Logger log = Logger.getRootLogger();

    public static void main(String[] args) {
        /* Fix for poor OpenJDK performance. */
        System.setProperty("sun.java2d.pmoffscreen", "false");

        /* Prepare logging. */
        BasicConfigurator.configure();
        if (debug)
            log.setLevel(Level.TRACE);

        universe = new Universe();
        viewer = new Viewer(universe);

        JFrame frame = new JFrame(TITLE);
        frame.add(viewer);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
        viewer.requestFocusInWindow();

        Sound.init();

        universe.start();
    }
}

@@ -708,24 +708,47 @@
 el.TRACE);%0A%0A
+        Sound.init();%0A%0A
         univ
@@ -1035,39 +1035,16 @@
 dow();%0A%0A
-        Sound.init();%0A%0A
         

Move sound initialization up before showing the window.