Mercurial > jmeCapture
comparison src/com/aurellem/capture/examples/Basic.java @ 15:be5ac56826be
created part of the advanced documentation
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 28 Oct 2011 06:52:46 -0700 |
parents | e299cd89074d |
children | c7a07eefaeea |
comparison
equal
deleted
inserted
replaced
14:e299cd89074d | 15:be5ac56826be |
---|---|
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 public class Basic { | 26 public class Basic { |
27 | 27 |
28 public static void basicVideo() throws IOException{ | 28 public static void main(String[] ignore) throws IOException{ |
29 File video = File.createTempFile("HelloJME3", ".avi"); | 29 File video = File.createTempFile("JME-water-video", ".avi"); |
30 System.out.println("Saving video to: " + video.getCanonicalPath()); | 30 File audio = File.createTempFile("JME-water-audio", ".wav"); |
31 SimpleApplication app = new HelloJME3(); | |
32 app.setTimer(new IsoTimer(60)); | |
33 app.setShowSettings(false); | |
34 | 31 |
35 Capture.captureVideo(app, video); | 32 System.out.println(video.getCanonicalPath()); |
36 app.start(); | 33 System.out.println(audio.getCanonicalPath()); |
37 } | |
38 | |
39 public static void basicVideoGUI() throws IOException { | |
40 File video = File.createTempFile("GUI", ".avi"); | |
41 System.out.println("Saving video to: " + video.getCanonicalPath()); | |
42 SimpleApplication app = new TestNiftyExamples(); | |
43 app.setTimer(new IsoTimer(60)); | |
44 app.setShowSettings(false); | |
45 | |
46 Capture.captureVideo(app, video); | |
47 app.start(); | |
48 } | |
49 | |
50 public static void basicAudio() throws IOException{ | |
51 File audio = File.createTempFile("BasicAudio", ".wav"); | |
52 System.out.println("Saving audio to: " + audio.getCanonicalPath()); | |
53 SimpleApplication app = new HelloAudio(); | |
54 app.setTimer(new IsoTimer(60)); | |
55 app.setShowSettings(false); | |
56 | |
57 // you will not hear the audio while it is being captured. | |
58 Capture.captureAudio(app, audio); | |
59 | |
60 app.start(); | |
61 } | |
62 | |
63 public static void basicAudioVideo() throws IOException{ | |
64 File video = new File("/home/r/tmp/basicVideo.avi"); | |
65 File audio = new File("/home/r/tmp/basicAudio.wav"); | |
66 | 34 |
67 SimpleApplication app = new TestPostWater(); | 35 SimpleApplication app = new TestPostWater(); |
68 app.setTimer(new IsoTimer(60)); | 36 app.setTimer(new IsoTimer(60)); |
69 app.setShowSettings(false); | 37 app.setShowSettings(false); |
70 | 38 |
71 Capture.captureVideo(app, video); | 39 Capture.captureVideo(app, video); |
72 Capture.captureAudio(app, audio); | 40 Capture.captureAudio(app, audio); |
73 | 41 |
74 app.start(); | 42 app.start(); |
75 } | 43 } |
76 | |
77 | |
78 public static void main(String[] ignore) throws IOException{ | |
79 basicVideo(); | |
80 basicVideoGUI(); | |
81 basicAudio(); | |
82 basicAudioVideo(); | |
83 } | |
84 } | 44 } |