comparison src/com/aurellem/capture/hello/BasicAVRecord.java @ 12:d10f4d4ff15a

going to improve documentation
author Robert McIntyre <rlm@mit.edu>
date Thu, 27 Oct 2011 21:07:50 -0700
parents
children
comparison
equal deleted inserted replaced
11:8a6b1684f536 12:d10f4d4ff15a
1 package com.aurellem.capture.hello;
2
3 import java.io.File;
4 import java.io.IOException;
5
6 import jme3test.helloworld.HelloAudio;
7 import jme3test.helloworld.HelloJME3;
8 import jme3test.niftygui.TestNiftyExamples;
9 import jme3test.water.TestPostWater;
10
11 import com.aurellem.capture.Capture;
12 import com.aurellem.capture.IsoTimer;
13 import com.jme3.app.SimpleApplication;
14
15
16 /**
17 *
18 * Demonstrates how to use basic Audio/Video capture with a jMonkeyEngine
19 * application.
20 *
21 * @author Robert McIntyre
22 *
23 */
24
25 public class BasicAVRecord {
26
27 public static void basicVideo() throws IOException{
28 File video = File.createTempFile("HelloJME3", ".avi");
29 System.out.println("Saving video to: " + video.getCanonicalPath());
30 SimpleApplication app = new HelloJME3();
31 app.setTimer(new IsoTimer(60));
32
33 Capture.captureVideo(app, video);
34 app.start();
35 }
36
37 public static void basicVideoGUI() throws IOException {
38 File video = File.createTempFile("GUI", ".avi");
39 System.out.println("Saving video to: " + video.getCanonicalPath());
40 SimpleApplication app = new TestNiftyExamples();
41 app.setTimer(new IsoTimer(60));
42
43 Capture.captureVideo(app, video);
44 app.start();
45 }
46
47 public static void basicAudio() throws IOException{
48 File audio = File.createTempFile("BasicAudio", ".wav");
49 System.out.println("Saving audio to: " + audio.getCanonicalPath());
50 SimpleApplication app = new HelloAudio();
51 app.setTimer(new IsoTimer(60));
52
53 // you will not hear the audio while it is being captured.
54 Capture.captureAudio(app, audio);
55
56 app.start();
57 }
58
59 public static void basicAudioVideo() throws IOException{
60 File video = new File("/home/r/tmp/basicVideo.avi");
61 File audio = new File("/home/r/tmp/basicAudio.wav");
62
63 SimpleApplication app = new TestPostWater();
64 app.setTimer(new IsoTimer(60));
65
66 Capture.captureVideo(app, video);
67 Capture.captureAudio(app, audio);
68
69 app.start();
70 }
71
72
73 public static void main(String[] ignore) throws IOException{
74 basicAudio();
75 }
76 }