diff --git a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java index 207070b..00ad492 100644 --- a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java +++ b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java @@ -315,12 +315,18 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { CLI.addParameter("debug", "", Boolean.class, "Enable debug output"); CLI.addParameter("trace", "", Boolean.class, "Enable function tracing"); + CLI.addParameter("opengl", "", Boolean.class, "Enable OpenGL graphical acceleration"); String[] argv = CLI.process(args); Debug.debugEnabled = CLI.isSet("debug"); Debug.traceEnabled = CLI.isSet("trace"); + if (CLI.isSet("opengl")) { + Properties props = System.getProperties(); + props.setProperty("sun.java2d.opengl", "true"); + } + processQueue = new ArrayDeque(); try { @@ -1080,8 +1086,6 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { public static void main(String args[]) { Debug.trace(); - Properties props = System.getProperties(); - props.setProperty("sun.java2d.opengl", "true"); try { config.load(AudiobookRecorder.class.getResourceAsStream("config.txt")); } catch (Exception e) { diff --git a/src/uk/co/majenko/audiobookrecorder/Options.java b/src/uk/co/majenko/audiobookrecorder/Options.java index e1af282..cf4aef7 100644 --- a/src/uk/co/majenko/audiobookrecorder/Options.java +++ b/src/uk/co/majenko/audiobookrecorder/Options.java @@ -522,6 +522,10 @@ public class Options extends JDialog { validFormats.add(new AudioFormat(96000f, 16, 2, true, false)); validFormats.add(new AudioFormat(96000f, 24, 1, true, false)); validFormats.add(new AudioFormat(96000f, 24, 2, true, false)); + validFormats.add(new AudioFormat(192000f, 16, 1, true, false)); + validFormats.add(new AudioFormat(192000f, 16, 2, true, false)); + validFormats.add(new AudioFormat(192000f, 24, 1, true, false)); + validFormats.add(new AudioFormat(192000f, 24, 2, true, false)); Mixer.Info[] info = AudioSystem.getMixerInfo(); for (Mixer.Info i : info) { @@ -554,10 +558,11 @@ public class Options extends JDialog { } static KVPair[] getSampleRateList() { - KVPair[] l = new KVPair[3]; + KVPair[] l = new KVPair[4]; l[0] = new KVPair("44100", "44100"); l[1] = new KVPair("48000", "48000"); l[2] = new KVPair("96000", "96000"); + l[2] = new KVPair("192000", "192000"); return l; } @@ -789,9 +794,10 @@ public class Options extends JDialog { } public static KVPair[] getResolutionList() { - KVPair[] pairs = new KVPair[2]; + KVPair[] pairs = new KVPair[3]; pairs[0] = new KVPair("16", "16 Bit"); pairs[1] = new KVPair("24", "24 Bit"); + pairs[1] = new KVPair("32", "32 Bit"); return pairs; } diff --git a/src/uk/co/majenko/audiobookrecorder/Sentence.java b/src/uk/co/majenko/audiobookrecorder/Sentence.java index b7a0cbe..a8bdba5 100644 --- a/src/uk/co/majenko/audiobookrecorder/Sentence.java +++ b/src/uk/co/majenko/audiobookrecorder/Sentence.java @@ -133,7 +133,10 @@ public class Sentence extends BookTreeNode implements Cacheable { try { running = true; recording = true; - byte[] buf = new byte[1024]; //AudiobookRecorder.window.microphone.getBufferSize()]; + + final int numFrames = 512; + final int bufSize = numFrames * format.getFrameSize(); + byte[] buf = new byte[bufSize]; //AudiobookRecorder.window.microphone.getBufferSize()]; FileOutputStream fos = new FileOutputStream(tempFile); int len = 0; Microphone.flush();