How to play/record at same time and save image from video

i started working on a project and that made my life hell although it was so simple. reason was that i couldnt find small/simple code to understand problems and no proper documents. . finally i have done that. and here is the code (without much complex code of interface). it shows vidoe, records a small part of it at start and takes a snapshot (no buttons or events involved). hope it might help someone starting to learn JMF.
import java.io.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
import java.util.Vector;
import javax.media.*;
import javax.media.rtp.*;
import javax.media.rtp.event.*;
import javax.media.rtp.rtcp.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.media.format.AudioFormat;
import javax.media.format.VideoFormat;
import javax.media.Format;
import javax.media.format.FormatChangeEvent;
import javax.media.control.BufferControl;
import javax.media.control.FrameGrabbingControl;
import javax.imageio.ImageIO;
import java.util.Date;
import javax.media.util.BufferToImage;
import java.awt.image.BufferedImage;
* AVReceive2 to receive RTP transmission using the new RTP API.
public class AVReceive2 implements ReceiveStreamListener, SessionListener,
ControllerListener
public static DataSource ds2, ds, ds3;
String sessions[] = null;
RTPManager mgrs[] = null;
Vector playerWindows = null;
boolean dataReceived = false;
Object dataSync = new Object();
public AVReceive2(String sessions[]) {
this.sessions = sessions;
public static DataSource getData() {
return ds;
protected boolean initialize() {
try {
InetAddress ipAddr;
SessionAddress localAddr = new SessionAddress();
SessionAddress destAddr;
mgrs = new RTPManager[sessions.length];
playerWindows = new Vector();
SessionLabel session;
// Open the RTP sessions.
for (int i = 0; i < sessions.length; i++) {
// Parse the session addresses.
try {
session = new SessionLabel(sessions);
} catch (IllegalArgumentException e) {
System.err.println("Failed to parse the session address given: " + sessions[i]);
return false;
System.err.println(" - Open RTP session for: addr: " + session.addr + " port: " + session.port + " ttl: " + session.ttl);
mgrs[i] = (RTPManager) RTPManager.newInstance();
mgrs[i].addSessionListener(this);
mgrs[i].addReceiveStreamListener(this);
ipAddr = InetAddress.getByName(session.addr);
if( ipAddr.isMulticastAddress()) {
// local and remote address pairs are identical:
localAddr= new SessionAddress( ipAddr,
session.port,
session.ttl);
destAddr = new SessionAddress( ipAddr,
session.port,
session.ttl);
} else {
localAddr= new SessionAddress( InetAddress.getLocalHost(),
session.port);
destAddr = new SessionAddress( ipAddr, session.port);
mgrs[i].initialize( localAddr);
// You can try out some other buffer size to see
// if you can get better smoothness.
BufferControl bc = (BufferControl)mgrs[i].getControl("javax.media.control.BufferControl");
if (bc != null)
bc.setBufferLength(350);
mgrs[i].addTarget(destAddr);
} catch (Exception e){
System.err.println("Cannot create the RTP Session: " + e.getMessage());
return false;
// Wait for data to arrive before moving on.
long then = System.currentTimeMillis();
long waitingPeriod = 30000; // wait for a maximum of 30 secs.
try{
synchronized (dataSync) {
while (!dataReceived &&
System.currentTimeMillis() - then < waitingPeriod) {
if (!dataReceived)
System.err.println(" - Waiting for RTP data to arrive...");
dataSync.wait(1000);
} catch (Exception e) {}
if (!dataReceived) {
System.err.println("No RTP data was received.");
close();
return false;
return true;
public boolean isDone() {
//return playerWindows.size() == 0;
return false;
* Close the players and the session managers.
protected void close() {
for (int i = 0; i < playerWindows.size(); i++) {
try {
((PlayerWindow)playerWindows.elementAt(i)).close();
} catch (Exception e) {}
playerWindows.removeAllElements();
// close the RTP session.
for (int i = 0; i < mgrs.length; i++) {
if (mgrs[i] != null) {
mgrs[i].removeTargets( "Closing session from AVReceive2");
mgrs[i].dispose();
mgrs[i] = null;
PlayerWindow find(Player p) {
for (int i = 0; i < playerWindows.size(); i++) {
PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
if (pw.player == p)
return pw;
return null;
PlayerWindow find(ReceiveStream strm) {
for (int i = 0; i < playerWindows.size(); i++) {
PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
if (pw.stream == strm)
return pw;
return null;
* SessionListener.
public synchronized void update(SessionEvent evt) {
if (evt instanceof NewParticipantEvent) {
Participant p = ((NewParticipantEvent)evt).getParticipant();
System.err.println(" - A new participant had just joined: " + p.getCNAME());
* ReceiveStreamListener
public synchronized void update( ReceiveStreamEvent evt) {
RTPManager mgr = (RTPManager)evt.getSource();
Participant participant = evt.getParticipant();     // could be null.
ReceiveStream stream = evt.getReceiveStream(); // could be null.
if (evt instanceof RemotePayloadChangeEvent) {
System.err.println(" - Received an RTP PayloadChangeEvent.");
System.err.println("Sorry, cannot handle payload change.");
System.exit(0);
else if (evt instanceof NewReceiveStreamEvent) {
try {
stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
//DataSource
ds2 = stream.getDataSource(); // this original cant be used now
// ds is used to play video
ds = Manager.createCloneableDataSource(ds2);
// ds3 is used to record video
ds3 = ((SourceCloneable)ds).createClone();
// Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
if (ctl != null){
System.err.println(" - Recevied new RTP stream: " + ctl.getFormat());
} else
System.err.println(" - Recevied new RTP stream");
if (participant == null)
System.err.println(" The sender of this stream had yet to be identified.");
else {
System.err.println(" The stream comes from: " + participant.getCNAME());
// create a player by passing datasource to the Media Manager
Player p = javax.media.Manager.createPlayer(ds);
if (p == null)
return;
p.addControllerListener(this);
p.realize();
PlayerWindow pw = new PlayerWindow(p, stream);
playerWindows.addElement(pw);
// Notify intialize() that a new stream had arrived.
synchronized (dataSync) {
dataReceived = true;
dataSync.notifyAll();
} catch (Exception e) {
e.printStackTrace();
return;
else if (evt instanceof StreamMappedEvent) {
if (stream != null && stream.getDataSource() != null) {
DataSource ds = stream.getDataSource();
// Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
System.err.println(" - The previously unidentified stream ");
if (ctl != null)
System.err.println(" " + ctl.getFormat());
System.err.println(" had now been identified as sent by: " + participant.getCNAME());
else if (evt instanceof ByeEvent) {
System.err.println(" - Got \"bye\" from: " + participant.getCNAME());
PlayerWindow pw = find(stream);
if (pw != null) {
pw.close();
playerWindows.removeElement(pw);
* ControllerListener for the Players.
public synchronized void controllerUpdate(ControllerEvent ce) {
Player p = (Player)ce.getSourceController();
if (p == null)
return;
// Get this when the internal players are realized.
if (ce instanceof RealizeCompleteEvent) {
PlayerWindow pw = find(p);
if (pw == null) {
// Some strange happened.
System.err.println("Internal error!");
System.exit(-1);
pw.initialize();
pw.setVisible(true);
p.start();
try {
// make it wait so that video can start otherwise image will be null. u must call this method with a button
Thread.sleep(2500);
catch (Exception e) {
e.printStackTrace();
// Grab a frame from the capture device
FrameGrabbingControl frameGrabber = (FrameGrabbingControl) p.getControl(
"javax.media.control.FrameGrabbingControl");
Buffer buf = frameGrabber.grabFrame();
// Convert frame to an buffered image so it can be processed and saved
Image img = (new BufferToImage( (VideoFormat) buf.getFormat()).
createImage(buf));
BufferedImage buffImg = new BufferedImage(img.getWidth(null),
img.getHeight(null),
BufferedImage.TYPE_INT_RGB);
Graphics2D g = buffImg.createGraphics();
g.drawImage(img, null, null);
// Overlay curent time on image
g.setColor(Color.RED);
g.setFont(new Font("Verdana", Font.BOLD, 12));
g.drawString( (new Date()).toString(), 10, 25);
try { // Save image to disk as PNG
ImageIO.write(buffImg, "jpeg", new File("c:\\webcam.jpg"));
catch (Exception e) {
e.printStackTrace();
// this will record the video for a few seconds. this should also be called properly by menu or buttons
record(ds3);
if (ce instanceof ControllerErrorEvent) {
p.removeControllerListener(this);
PlayerWindow pw = find(p);
if (pw != null) {
pw.close();
playerWindows.removeElement(pw);
System.err.println("AVReceive2 internal error: " + ce);
* A utility class to parse the session addresses.
class SessionLabel {
public String addr = null;
public int port;
public int ttl = 1;
SessionLabel(String session) throws IllegalArgumentException {
int off;
String portStr = null, ttlStr = null;
if (session != null && session.length() > 0) {
while (session.length() > 1 && session.charAt(0) == '/')
session = session.substring(1);
// Now see if there's a addr specified.
off = session.indexOf('/');
if (off == -1) {
if (!session.equals(""))
addr = session;
} else {
addr = session.substring(0, off);
session = session.substring(off + 1);
// Now see if there's a port specified
off = session.indexOf('/');
if (off == -1) {
if (!session.equals(""))
portStr = session;
} else {
portStr = session.substring(0, off);
session = session.substring(off + 1);
// Now see if there's a ttl specified
off = session.indexOf('/');
if (off == -1) {
if (!session.equals(""))
ttlStr = session;
} else {
ttlStr = session.substring(0, off);
if (addr == null)
throw new IllegalArgumentException();
if (portStr != null) {
try {
Integer integer = Integer.valueOf(portStr);
if (integer != null)
port = integer.intValue();
} catch (Throwable t) {
throw new IllegalArgumentException();
} else
throw new IllegalArgumentException();
if (ttlStr != null) {
try {
Integer integer = Integer.valueOf(ttlStr);
if (integer != null)
ttl = integer.intValue();
} catch (Throwable t) {
throw new IllegalArgumentException();
* GUI classes for the Player.
class PlayerWindow extends Frame {
Player player;
ReceiveStream stream;
PlayerWindow(Player p, ReceiveStream strm) {
player = p;
stream = strm;
public void initialize() {
add(new PlayerPanel(player));
public void close() {
player.close();
setVisible(false);
dispose();
public void addNotify() {
super.addNotify();
pack();
* GUI classes for the Player.
class PlayerPanel extends Panel {
Component vc, cc;
PlayerPanel(Player p) {
setLayout(new BorderLayout());
if ((vc = p.getVisualComponent()) != null)
add("Center", vc);
if ((cc = p.getControlPanelComponent()) != null)
add("South", cc);
public Dimension getPreferredSize() {
int w = 0, h = 0;
if (vc != null) {
Dimension size = vc.getPreferredSize();
w = size.width;
h = size.height;
if (cc != null) {
Dimension size = cc.getPreferredSize();
if (w == 0)
w = size.width;
h += size.height;
if (w < 160)
w = 160;
return new Dimension(w, h);
public void record(DataSource ds) {
Format formats[] = new Format[1];
formats[0] = new VideoFormat(VideoFormat.CINEPAK);
FileTypeDescriptor outputType =
new FileTypeDescriptor("video.x_msvideo");
Processor p = null;
try {
p = Manager.createRealizedProcessor(new ProcessorModel(ds,formats,
outputType));
} catch (IOException e) {
e.printStackTrace();
} catch (NoProcessorException e) {
e.printStackTrace();
} catch (CannotRealizeException e) {
e.printStackTrace();
// get the output of the processor
DataSource source = p.getDataOutput();
// create a File protocol MediaLocator with the location
// of the file to
// which bits are to be written
MediaLocator dest = new MediaLocator("file://vvv.mpeg");
// create a datasink to do the file writing & open the
// sink to make sure
// we can write to it.
DataSink filewriter = null;
try {
filewriter = Manager.createDataSink(source, dest);
filewriter.open();
} catch (NoDataSinkException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SecurityException e) {
e.printStackTrace();
// now start the filewriter and processor
try {
filewriter.start();
} catch (IOException e) {
e.printStackTrace();
p.start();
try {
Thread.sleep(10000);
}catch(Exception e) { }
p.close();
filewriter.close();
// stop and close the processor when done capturing...
// close the datasink when EndOfStream event is received...
public static void main(String argv[]) {
//     if (argv.length == 0)
//     prUsage();
String[] a = new String[1];
a[0] = ("192.168.0.45/4002");
AVReceive2 avReceive = new AVReceive2(a);
if (!avReceive.initialize()) {
System.err.println("Failed to initialize the sessions.");
System.exit(-1);
// Check to see if AVReceive2 is done.
try {
while (!avReceive.isDone())
Thread.sleep(1000);
} catch (Exception e) {}
System.err.println("Exiting AVReceive2");
static void prUsage() {
System.err.println("Usage: AVReceive2 <session> <session> ...");
System.err.println(" <session>: <address>/<port>/<ttl>");
//System.exit(0);
}// end of AVReceive2
so here the code. all messed up. coz i have just completed it and havent worked on interface or formatting this code properly (didnt have much time). but hope it will help. ask me if u have any questions. dont want others to have those basic problems that i had to face.

u did a good effort for the JMF beginners i appreciate that....thanks i lot....i need you help in a project in
which i have to connect to a d-link 950G IP camera and process that
mpeg-4 stream (i know there are some problems in JMF and mpeg4) and show it over applet of JFrame.
IP is 172.25.35.22
Edited by: alchemist on Jul 16, 2008 6:09 AM

Similar Messages

  • Get and save image from camera

    Hi I need to grab an image from a camera and save it in a known format (such as TIF).  What is the best way to do this in LabView.  We are using an EDT camera via a PCI DV C-Link http://www.edt.com/pcidv_cl.html.  Appreciate any help/ guidance.

    EDT says:
    Do you have Labview drivers? Matlab? IDL? Others?
    Not
    directly. Our API is designed to allow programmers to build
    functionality into their applications, and all hooks are available to
    make EDT API subroutine calls from drivers for third party packages,
    but we do not provide the drivers ourselves. Some drivers are available
    from other providers; see our Partners page.
    So you will need to use the Call Library Function Node to integrate their Drivers DLL into your LV. How to save the images then in a standart format depends on the data format you get from their driver.
    Using an NI Framegrabber would be easier
    Christian 

  • How can I record a voice over and save as MP3?

    Good morning! I do voice overs. In my studio I STILL have a PC and use adobe audition. For my day to day business I know have a MAC BOOK PRO. I am going on vacation and need to record on my MacBook Pro with Garage Band.
    I have successfully set up my Mic(studio Projects C1) and my travel PreAmp (MAudioDuo) to record in Garage Band. All I need is dry voice. I have recorded a track but need to save is as an MP3. The test track I recorded is about 15 seconds long but yet plays for 30 seconds...I have deleted everything after the voice but it still seems like the track is longer. I have to put in MP3 format. How do I do this? This is a nice program but looks like it is too much for what I need it to do. So, any other recommendations on more appropriate software is appreciated if needed.
    Message was edited by: suesmac

    yet plays for 30 seconds.
    move the end of project marker to the 15 second mark:
    http://www.bulletsandbones.com/GB/GBFAQ.html#eos
    I have to put in MP3 format.
    when you "share" it, tick the Compress checkBox
    any other recommendations on more appropriate software
    any audio editor could be used as well:
    http://www.bulletsandbones.com/GB/GBFAQ.html#audioeditors

  • How do i sync the tempos for two different tracks playing at the same time?

    i am new to audition so i apologize if there is an easy answer to this question, but...
    i upload two different two different songs and i want to get them to play at the same time and sound halfway decent. how do i get the tempos to match?

    http://www.adobeforums.com/webx/.2cccd873/0

  • How do you stop multiple Youtube videos from playing at the same time?

    As of a few days ago, when I click on a youtube video, as the commercial begins to play, you can begin to hear multiple/different commercials playing at the same time. After the commercials, the same issue occurs with the main video--multiple videos are being played at the same time and are not in sync. I've updated all my plug ins and have tried the suggestion posted in the forum provided in the link below in which someone else has expressed the same issue, but nothing has worked so far. Does anyone know what can be done?
    http://productforums.google.com/forum/#!topic/youtube/5Lnikma4UqM

    Are you loading those videos as Flash or HTML5? It is possible to prevent videos from playing until you click something with Flashblock for Flash or Stop Tube HTML5 for HTML5. You can also stop the commercials with Adblock Plus with an Easylist subscription.
    * https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/
    * https://addons.mozilla.org/en-US/firefox/addon/flashblock/
    * https://addons.mozilla.org/en-US/firefox/addon/stop-tube/

  • Generat two signals at the same time and reading voltage

    Hii
    i have try to generate two signals at the same time and read voltage from another port on the board(not have to be at the same time), i have not alot of expriens in labview
    and i based my code of example(http://zone.ni.com/devzone/cda/epd/p/id/5197) from yours site and try to suit to my needs
    now my problem is when i generat the 2 signals(that work perfect) i canot read voltage from another port on my CB-68LP
    i can not find the problem  and make it over i hope there is away to figer out and fix it.
    i have two cards 6229, and two CB-68LP board.
    labview 8.5.
    my code is look like this - http://img142.imageshack.us/my.php?image=scrennshot2no2.png
    (this works perfect).
    and this is my code after suit to my need - http://img183.imageshack.us/my.php?image=scrennshotfl5.png,there is  error exception at  the right side.
    the exception-
    Possible reason(s):
    Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: RefClk.Src
    Source Device: Dev1
    Source Terminal: 10MHzRefClock
    Required Resources in Use by
    Task Name: _unnamedTask<0>
    Source Device: Dev1
    Source Terminal: None
    Destination Device: Dev1
    Destination Terminal: RefClock
    Task Name: _unnamedTask<1>
    eyal

    sorry...
    The AO tasks is very important they will be synchronize ,it is very importent the two tasks will start at the same time
    and after it run at synchronize mode i will need to make reading of voltage
    i gust try to make simulation of machin (i give that machin AO and reading from it voltage that all)
    first of all i make the two signals(synchronize signals).
    and after it i will need to reading voltage.
    i can make two signals synchronize together.
    i can make reading voltage
    but i can't make two signals synchronize together with reading voltage
    it throw to me this error message.
    i am looking for away to figer this out.
    thank's for any help 
    eyal
    Attachments:
    test11.vi ‏130 KB

  • Multiclips and multiple audio tracks playing at the same time

    I've only just taken delivery of my first ever mac (only ever used PC) with FCP, and I'm loving it already! Done lots of reading and viewing of video etc etc, and it's not as daunting as I thought it might be. I have one question the books don't seem to answer, and I can only find one reference to this on this site, with no definitive response. FCP5 probably doesn't work this way, but just in case someone knows different......
    I film and edit motorsport (karting) programmes for television in the UK, using multiple cameras. I usually lay all the video and audio tracks on the timeline, (synched) lock the audio for each (as it is engine noise, and I want it playing without abrupt changes at cuts as each kart passes each camera, whether in shot or not) then cut the video tracks and delete those video segments not required.
    The most exciting aspect of FCP5 for me is the multiclip editing facility, which I have found very easy to learn and is going to save me hours of work! However, I want to know if there is a way of having each audio track from each camera used in the multiclip laid down on the timeline when you import the multiclip to the timeline from the viewer, in order that I can play each audio track from each of the cameras at the same time.
    I know how to cut from angle to angle, leaving the audio from the selected angle as the one audio track playing, but I want all of the tracks to appear in the timeline and play at the same time. I know there's a bit of a workaround by locking the video and importing each audio track from each clip independently, but if you do have to re-synch one of the multiclips, this means the audio is not then synched with the original clip, which will have had an in point set before being imported in as part of a multiclip.
    I can understand why you might want to keep audio from one camera only playing over the whole multiclip, or to switch between audio from each, but in my case I prefer all audio to play at the same time. The workaround is still do-able for me as I'm only talking about engine notes, which if they are a few frames out is not very noticeable at all, but I would like to know if I'm right in thinking I cannot do it the way I would like to?
    Wish I'd used FCP from the start, but glad I've got it now.....especially with the 30 inch screen! It's 4.40am, been going over 19 hours straight and I'm still making comments like...."WOW, that's brilliant"...every half hour!
    G5   Mac OS X (10.4.3)   Quad, 8gb ram, 2 x G-Media GRaid 500gb Raids, 30 + 20 inch Cinema screens

    ...

  • How to get 2 xml(Sibling tag) content same time and merge them

    how to get 2 xml(Sibling tag) content same time and merge them and search the result value in indesign file with page number  
    Like
    <Record>
    <A>this is a text</A>
    <B>a-123</B>
    </Records>
    First we need  tag A and B value as  :
    this is a text - a-123 and then get  this text page number form the indesign doc
    plz help

    hi
    var root = app.activeDocument.xmlElements[0];
    var aTag = root.evaluateXPathExpression("//Record/INAAMF");
    var bTag = root.evaluateXPathExpression("//Record/IAFKF");
    here I got  aTag  and bTag  = empty
    may be the reason is as I forgot to menion the proper XML path as
    <Records>
    <Record>
    <A>this is a text</A>
    <B>a-123</B>
    </Record>
    <Record>
    <A>Second text</A>
    <B>a-132</B>
    </Record>
    <Record>
    <A>Thied text</A>
    <B></B>
    </Record>
    <Records>

  • IPod Touch 4g won't charge and play at the same time

    I used to have a 4g Nano that I would play in my car through an aux cable and charge through a cigarette lighter charger. I just got a 4th gen iPod Touch and it no longer lets me charge and play at the same time. If both wires are connected it will only charge and not play, once I pull the charger part out it will play through the speakers. Is there a fix to this? Do I need a different charger so that it won't think it's simply docked?

    You would need to turn off hard drive mode via iTunes iPod settings on your home system to do this. I don't know if you have this mode on or off already. I thought I read that there is a way to enable/disable hard drive mode via the iPod buttons but I don't remember how.
    Thanks,
    Steven

  • Hp pavilion g7; speakers and headsets playing at the same time suddenly.

    When i woke up this morning, I found out that my speakers and headsets are both playing at the same time. It did not do this before and I've been really stumped in finding a fix. I have gone through most the the related threads about this online but none of the fixes have worked for me not even system restore.

    Hi percepter,
    Welcome to the HP Support Forums! 
    I understand that you have developed a problem with your speakers and your headphones for your HP Pavilion g7 Notebook PC. I will try my best to help you with this.
    I suggest following the steps in this document for Troubleshooting Sound Problems with External Speakers and Headsets in Windows 7 for preforming a Windows sound test, to see what is causing this issue.
    I hope this helps, please let me know how it goes.
    Thank you and have a great day!
    I worked on behalf of HP.

  • How to open 2 playlist at the same time and have them in two diferents windows?

    until iTunes 10 i can open more than one playlist at the same time, and have this playlist in diferents windos but since 11 i cannot do it anymore.. is anoying if i need to fast switc music froms playlists.. so it become usseless...
    i think the aim of the previous itunes (before 10) it was to give a service of arranging librerys of musics.. but now, it becomes a sell party program...
    and only to you to know, if i dont put my credit card on my account i cannot even buy FREE programs on appstore...
    thats bad... very bad..
    if you need some tips how to do it proprerly here you got one..
    if is not broken... dont fix it...
    now i have my iphone 6, my ipad and the iphone of my wife, but i have itunes 10 because is the one who have the multi windows possibilities.. and now i cannot sync the devices..
    thats very bad..
    i hope you can help me...
    if you dont understand my problem i can show you via video..
    thanks

    You could create an applescript to do it.
    tell application "Dreamweaver's Full Name"
    activate
    end tell
    tell application "BBEdit's Full Name"
    activate
    end tell
    tell application "Acrobat's Full Name"
    activate
    end tell
    Replace the quoted text (leaving the quotes) with the full name of the application, and save the applescript as an application bundle, and put it in your dock.
    NOTE: You may have to put the full path to the application for it to work (I.E. /Applications/Dreamweaver.app). If you do, encase the full path in quotes.
    Good luck!
    Message was edited by: joshz

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • I am having mac book air 2012model i had installed mavericks and use it, i long press command and power button at a same time and i saw the command prompt, from that i had formated the total hard disk. how to i want to install the OS again ?

    I am having mac book air 2012model i had installed mavericks and use it, i long press command and power button at a same time and i saw the command prompt, from that i had formated the total hard disk. how to i want to install the OS again ?
    i tryed with download mavericks but finally its saying a error message like cant conect to istore like that its saying and every thing is clear like internet and other stuf i tryed with 3times no progress same error pls help.. i bought this lap for my bro with his apple id only we use it now he got a new mac book pro so he gave to me so i formated and use it i use my apple id is that problem come because of changing apple id ? pls eplain

    Firstly, what is the source of the 10.6.4 disc? Is it the original installation disc for your MacBook, or one 'borrowed' from another computer?
    It isn't the retail version, because that's 10.6.3.
    Assuming it's the correct disc (i.e. the one that shipped with your Mac), you need to boot from it again.
    OK the language page.
    From the installer screen, ignore the continue button, go to the menu bar and choose Disk Utility from the Utilities menu.
    In DU, select your internal drive in the sidebar (the top item with the makers name and serial no.).
    Run Repair Disk. If that comes up as disk OK, click the partition tab. Select the partiton from the drop-down above the graphic; 1 partiton is all you need.
    Go to the options button and ensure that the partition scheme is GUID and the file system to Mac OS Extended (Journalled). Name the partiton (usually Macintosh HD), click Apply.
    When the Macintosh HD volume appears below the drive name, quit DU and see if you can then install.
    If the screen after the language screen doesn't show the menu bar, it may be necessary to use another Mac to do the job with the MB in Firewire Target Disc Mode. If it won't boot in TDM, or the MB doesn't have FireWire then it's getting very difficult.

  • How do you start 2+ audio files playing at the same time?

    I am trying to play 2 audio files at the same time, but I cannot figure out how to start them playing at the same time without latency issues.
    If someone can please explain the process for doing this using Audio Queue Services, I will forever be in your debt.
    This is for iPhone, but I was getting no love in those forums on this issue.

    Thanks for your reply. Apple's iPhone Application Programming Guide states the Following:
    *Playing Multiple Sounds Simultaneously*
    To play multiple sounds simultaneously, create one playback audio queue object for each sound. For each audio queue, schedule the first buffer of audio to start at the same time using the AudioQueueEnqueueBufferWithParameters function.
    This leads me to believe that it is possible. I have just not been able to get them to play precisely the same time, there is always delay.

  • When I was setting up the language Setting, I pressed the play/pause button three times and now the voice that talks you through everything speaks extremely fast. How do I get her to speak slower?

    When I was setting up the language Setting, I pressed the play/pause button three times and now the voice that talks you through everything speaks extremely fast. How do I get her to speak slower?

    Hi Magsrobby,
    Welcome to the forum and thanks for posting. I'm really sorry to hear you've had so many problems. I can look into this for you if you wish. Drop me an email with the details. You'll find the "contact us" form in the about me section of my profile. Once I have the details we'll take it from there.
    Cheers
    David
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

Maybe you are looking for