comparison src/com/aurellem/capture/Capture.java @ 24:5f616cc420dd

improved WaveFileWriter using tritonus
author Robert McIntyre <rlm@mit.edu>
date Sun, 30 Oct 2011 04:42:40 -0700
parents d10f4d4ff15a
children 784a3f4e6202
comparison
equal deleted inserted replaced
23:b643413c3aba 24:5f616cc420dd
54 54
55 public static void captureAudio(final Application app, final File file) throws IOException{ 55 public static void captureAudio(final Application app, final File file) throws IOException{
56 AppSettings settings = new AppSettings(true); 56 AppSettings settings = new AppSettings(true);
57 settings.setAudioRenderer("Send"); 57 settings.setAudioRenderer("Send");
58 app.setSettings(settings); 58 app.setSettings(settings);
59 final WaveFileWriter writer = new WaveFileWriter(file);
59 60
60 Callable<Object> thunk = new Callable<Object>(){ 61 Callable<Object> thunk = new Callable<Object>(){
61 public Object call(){ 62 public Object call(){
62 AudioRenderer ar = app.getAudioRenderer(); 63 AudioRenderer ar = app.getAudioRenderer();
63 if (ar instanceof MultiListener){ 64 if (ar instanceof MultiListener){
64 MultiListener ml = (MultiListener)ar; 65 MultiListener ml = (MultiListener)ar;
65 ml.registerSoundProcessor(new WaveFileWriter(file)); 66 ml.registerSoundProcessor(writer);
66 } 67 }
67 return null; 68 return null;
68 } 69 }
69 }; 70 };
70 71