I need a buffer to capture audia from a microphone

I need to save audio data, while recording, in a buffer, but i dont know what are the classe i have to use an where to put the necessary code. Here is some code i use for capturing audio from a microphone. I appreciate if you can help me.
Vector deviceList = CaptureDeviceManager.getDeviceList(new AudioFormat("LINEAR", 48000, 16, 2));
processor = Manager.createProcessor(device.getLocator());
processor.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.MPEG_AUDIO));
dataSource= processor.getDataOutput();
path = System.getProperty ( "user.home" );
String nombre="prueba";
DatSink dest = new MediaLocator("file:"+path+File.separator+nombre);
filewriter = Manager.createDataSink(dataSource, dest);
filewriter.open();
filewriter.start();
processor.start();

You do realize that JMF does not record MP3 files, right?
And if you want to put a buffer in somewhere, you can put it anywhere you want...but the most logical spot would be inside of the DataSource that's capturing the audio.
[http://wiki.java.net/bin/view/Javapedia/JavaSoundDataSourceSampleProgram]
You could use that code, and just insert a buffer in the read function...

Similar Messages

  • Capturing audio from microphone and save it to a file

    Hi!!
    I'm searching for a code using JavaSound that allows capturing audio from a microphone and save it to a file.
    thanks in advance and sorry for my English

    Hi,
    Check out these links.
    http://developer.java.sun.com/developer/technicalArticles/Media/JavaSoundAPI/
    http://java.sun.com/j2se/1.3/docs/guide/sound/prog_guide/chapter5.fm.html
    Also this is a very good site for finding similar issue as yours.
    http://www.jsresources.org/examples/audio.html
    Hope this helps.
    Regards,
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • What type of firewire cables do I need to capture recorings from my canon xm2

    What type of firewire cables do I need to capture recorings from my canon xm2

    I have a:
    Model Name:          Mac Pro
      Model Identifier:          MacPro5,1
      Processor Name:          Quad-Core Intel Xeon
      Processor Speed:          2,4 GHz
      Number Of Processors:          2
      Total Number Of Cores:          8
      L2 Cache (per core):          256 KB
      L3 Cache (per processor):          12 MB
      Memory:          6 GB
      Processor Interconnect Speed:          5.86 GT/s
      Boot ROM Version:          MP51.007F.B03
      SMC Version (system):          1.39f11
      SMC Version (processor tray):          1.39f11
      Serial Number (system):          CK12002NHF8
      Serial Number (processor tray):          J511400HYBH8C    
      Hardware UUID:          F51FCFBA-869D-5D70-A1F6-886A32871AA0

  • Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic. can anyone tell me what is the best way to clone the environment, can I just tar the weblogic file syste

    Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic..
    Can anyone tell me what is the best way to cloning the application from different environment, the test and production are in different physical server.
    Can I just tar the weblogic file system and untar it to the new server and make the necessary changes?
    Can anyone share their experiences and how to with me?
    Thank in advance.
    Katherine

    Hi Katherine,
    yes and no . You need as well weblogic + soa files as the database schemas (soa_infra, mds...).
    Please refer to the AMIS Blog: https://technology.amis.nl/2011/08/11/clone-your-oracle-fmw-soa-suite-11g/
    HTH
    Borys

  • Suggestions for capturing video from HD source needed

    I'm wanting to capture video from my PS3 (using component or HDMI) and I have no idea what device is good. I'm not looking to spend a large sum of money but it has to be a USB or Firewire external device as I don't have a Mac Pro tower to install PCI cards... yet.
    I was looking at the Hauppauge HD PVR. Noticed it's not compatible with Mac's but saw if I purchase the elgato EyeTV software that it would work. I'm worried about compatibility and skeptical of trusting two products from two companies to work together without issue.
    So I was hoping people on here would have some suggestions.
    Thanks!

    Hope its not too late of a reply but the Hauppauge HD PVR is awesome! (that is, if you don't pick up a defective unit).
    I currently use one myself for capturing xbox 360 gaming clips on my hackintosh and have just figured out what the best settings are for native editing in FCP. You can read my reply in this thread for details:
    http://discussions.apple.com/click.jspa?searchID=-1&messageID=9485446
    I've found 2 apps (one of which is EyeTV 3) that allow you to capture to a Mac via USB2 cable. There's EyeTV 3 and then there's HDPVR Capture which can be found here:
    http://www.steventoth.net/blog/products/hdpvr-capture/
    I used HDPVR Capture first then got my hands on EyeTV 3 and I'll tell ya that EyeTV 3 has better export options. HDVPR-C outputs to M2TS or MP4. MP4 can be problematic when editing in FCP as I found out. But with EyeTV 3 you can export into a 100% native format for Final Cut Pro editing. HDPVR is cool though for a quick app to capture your clips. There's a free trial version that will only capture up to 2min. of footage.
    Btw, if you go with EyeTV 3 make sure you perform a software update after you install it because it doesn't support the Hauppauge HD PVR right off the bat in version 3.0 ..you need version 3.1.1 which you get free when you check for updates.
    hope this helps!

  • Unable to capture data from drop down list in custom added field in migo tcode at item level

    Hi guys,
    need bit help in resolving query related to custom added field in Tcode migo.
    i have added a field in migo at item level ,in this i have used drop down list
    to get data but unable to capture data from drop down list.gown through
    many blogs in scn but unable to resolve.
    Please help me out in this.
    Thanks,
    Umakant.

    Hi,
    U can use following code to fill the list box
    write this code in PBO
    In layout editor please select listbox in dropdown attribute of input field and put some fctcode attribute
    TYPE-POOLS vrm.
      DATA values TYPE vrm_values WITH HEADER LINE.
      TABLES: <ur custom Database table>.
      clear values, values[].
      SELECT * FROM <ur custom Database table>.
        values-text = <TABLE FIELD TO DISPLAY IN DROPDOWN> .
        values-key = <TABLE KEY FIELD TO DISPLAY IN DROPDOWN>.
        APPEND values.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = '<SCREEN INPUT FIELD NAME>'
          values          = values[]
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    Also please define the following before accessing the listbox value
    data: <listbox input field name> type <table field name>,
            <inputfield name where text to display> type string  in top include
    In PAI, select the text from the table into <inputfield name where text to display>  depending on value selected which will be called when enter key is pressed or any vale is selected

  • Capture contents from an editable alv

    I'm trying to capture fields from an editable alv. I have an update button in the application toolbar. So when i press this button, whatever changes I have done on the screen, the internal table should get updated. I'm using the function module    REUSE_ALV_GRID_DISPLAY.
    Can anybody help me out??

    Yes you can,
    If you have access to the element in the context that is bound to the row in the ALV then you can connect the message. Marking a * is not possible by default with the WD message manager and you willl need to do it manually. Use the element method of the message manager API for this purpose.

  • Capturing Audio from DAT

    Hello,
    I'm trying to capture audio from a DAT deck (Tascam DA-20) into FCP HD by routing it through my JVC BR-DV600U DV deck (RCA output from DAT, RCA input to DV deck, Firewire into FCP).
    The DV deck's input is set to line-in, and the audio is being routed through (audio meters on DV deck mimic those on DAT deck, and I can hear the audio through the headphones jacked into my DV deck).
    However, when I try to capture the audio on FCP, I am unsuccessful, prompting the following window from FCP: "Error: Final Cut Pro HD was unable to read the movie file just captured."
    Now, I use the same set up I described above to capture footage from my Beta deck into FCP with no problems (route Beta signal through DV deck and firewire it into FCP). This leads me to believe that perhaps the glitch lies within my Capture Presets.
    At first, I tried to capture the signal as an Audio-Only DV NTSC 48 Khz/Non-controllable device. After that failed, I tried to create my own capture preset, but am not sure it will make a difference, as the only input choices I am given are DV Audio, Built-In Audio, and None.
    Any suggestions?
    Thanks.

    Why not capture the audio content outside of FCP, check the sample rate for 48Khz/16-bit, convert if necessary, save as an AIFF file, and then import that resulting sound file into FCP?
    Any good audio app, including STP will do captures.
    You are probably going to need to do some cleanup on the audio anyway before you use it, so why not just use an audio app to do it beforehand?
    Besides, if you have an audio device (PCI card or Firewire device) in your Mac, you can use the S/PDIF port for your connection to the DAT and do a digital transfer when you import.
    As I understand the way you are doing it now, you are taking digital content from the DAT, converting it to analog for the connection into your deck, and then re-converting it into digital when you capture it back into FCP.
    One big advantage of digital audio (and video) is to avoid generation loss and added noise during transfer if you go D-to-D.
    If you don't have an audio card or Firewire A/D audio I/O device with S/PDIF ports in your Mac, then see if you can find a friend who has one and can do the transfer for you. Then he can give you the file on a CD-ROM.
    That's what I'd do.

  • Capturing data from usb webcam

    I'm interested in the acquisition of footage from a usb webcam into labVIEW. I have the professional development system and downloaded NI-IMAQ which I believe i'll need from reading online material.
    I don't really know where to start to link the camera with labview so any material would be a great help...
    Final question, is it a big undertaking acquiring data from a video camera in labVIEW? it's just i've limited time to work on a project and want to know if it's worthwhile undertaking or if it will be very time heavy. I've a few months labVIEW development experience if that would give an indication to anyone...
    Strokes 

    Hi,
    First your USB Cam needs to be DirectShow Compliant.
    Then you will need NI-IMAQdx from the Vision Acquisition Software 2009 (supports LV 8.2 and higher) or higher to acquire images from USB cameras. The NI IMAQ driver is to capture images from framegrabbers, and the NI SmartCamera, not for USB. There is also a own IMAQ USB Library for the Vision Acquisition 8.6 but since you need to buy the Acquisition Software I would recommend to use 2009 or higher where we added the DirectShow Support to IMAQdx.
    The Vision Acquisition Software is just for image acquisition and processing. If you want to do image processing you will need the Vision Development Module.
    And when doing a search at ni.com you should find some articles, examples and tutorials too.
    I can't estimate how much time you will need get that running, but you could just try to run one of the examples for IMAQdx in LabVIEW and then see how it works.
    Christian

  • Capturing footage from Canon XH A1

    Hi All -
    I'm a bit new to Final Cut Express but ran across the following problem:
    When I try to capture footage from my Canon XH A1 HD video camera, FCE does not recognize that there's any connection or that the camera is plugged into my MacBook Pro via the firewire cable. When I plug in my Sony VX2100 it does recognize this camera and I'm able to capture footage when I use that camera, but no luck with the Canon.
    Funny thing is, when I try to capture footage from my Canon using iMovie it recognizes the camera and captures the footage with no problem.
    Any idea why FCE is not recognizing this camera when iMovie does? Is there a setting on FCE that needs to be changed?
    Any help would be appreciated.
    Thanks!!

    Are you using the correct Easy Setup?
    Normally it should be HDV-Apple Intermediate Codec 1080i50 (or i60 if you are using NTSC).
    I believe your Canon is an HDV camera whilst your Sony shoots DV.
    They both need different Easy Setups. iMovie deals with this automatically.

  • I am planing to buy license of premier pro.I wan to capture picture from my camera .which card  i want to install ??

    i am planing to buy license of premier pro.I wan to capture picture from my camera .which card  i want to install ??

    If you're asking about Live Capture, where you record the camera feed direct to hard disk, then you need a Firewire interface or one of the (few) supported HDMI/SDI cards such as the AJA Kona, Matrox MX02 or BlackMagic Intensity Pro - however those have very specific motherboard requirements so you need to research them carefully before buying anything.
    For an intro to Live Capture I suggest you read the manual: Adobe Premiere Pro Help | Capturing and digitizing footage

  • Errors in code that captures images from webcam

    Here is the code
    import javax.swing.*;
    import javax.swing.border.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.datasink.*;
    import javax.media.format.*;
    import javax.media.protocol.*;
    import javax.media.util.*;
    import javax.media.control.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import com.sun.image.codec.jpeg.*;
    // import com.sun.media.vfw.VFWCapture; // JMF 2.1.1c version
    import com.sun.media.protocol.vfw.VFWCapture; // JMF 2.1.1e version
    public class JWebCam extends JFrame
    implements WindowListener, ComponentListener
    protected final static int MIN_WIDTH = 320;
    protected final static int MIN_HEIGHT = 240;
    protected static int shotCounter = 1;
    protected JLabel statusBar = null;
    protected JPanel visualContainer = null;
    protected Component visualComponent = null;
    protected JToolBar toolbar = null;
    protected MyToolBarAction formatButton = null;
    protected MyToolBarAction captureButton = null;
    protected Player player = null;
    protected CaptureDeviceInfo webCamDeviceInfo = null;
    protected MediaLocator ml = null;
    protected Dimension imageSize = null;
    protected FormatControl formatControl = null;
    protected VideoFormat currentFormat = null;
    protected Format[] videoFormats = null;
    protected MyVideoFormat[] myFormatList = null;
    protected boolean initialised = false;
    * Constructor
    public JWebCam ( String frameTitle )
    super ( frameTitle );
    try
    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    catch ( Exception cnfe )
    System.out.println ("Note : Cannot load look and feel settings");
    setSize ( 320, 260 ); // default size...
    addWindowListener ( this );
    addComponentListener ( this );
    getContentPane().setLayout ( new BorderLayout() );
    visualContainer = new JPanel();
    visualContainer.setLayout ( new BorderLayout() );
    getContentPane().add ( visualContainer, BorderLayout.CENTER );
    statusBar = new JLabel ("");
    statusBar.setBorder ( new EtchedBorder() );
    getContentPane().add ( statusBar, BorderLayout.SOUTH );
    * Initialise
    * @returns true if web cam is detected
    public boolean initialise ( )
    throws Exception
    return ( initialise ( autoDetect() ) );
    * Initialise
    * @params _deviceInfo, specific web cam device if not autodetected
    * @returns true if web cam is detected
    public boolean initialise ( CaptureDeviceInfo _deviceInfo )
    throws Exception
    statusBar.setText ( "Initialising...");
    webCamDeviceInfo = _deviceInfo;
    if ( webCamDeviceInfo != null )
    statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
    try
    setUpToolBar();
    getContentPane().add ( toolbar, BorderLayout.NORTH );
    ml = webCamDeviceInfo.getLocator();
    if ( ml != null )
    player = Manager.createRealizedPlayer ( ml );
    if ( player != null )
    player.start();
    formatControl = (FormatControl)player.getControl ( "javax.media.control.FormatControl" );
    videoFormats = webCamDeviceInfo.getFormats();
    visualComponent = player.getVisualComponent();
    if ( visualComponent != null )
    visualContainer.add ( visualComponent, BorderLayout.CENTER );
    myFormatList = new MyVideoFormat[videoFormats.length];
    for ( int i=0; i<videoFormats.length; i++ )
    myFormatList = new MyVideoFormat ( (VideoFormat)videoFormats );
    Format currFormat = formatControl.getFormat();
    if ( currFormat instanceof VideoFormat )
    currentFormat = (VideoFormat)currFormat;
    imageSize = currentFormat.getSize();
    visualContainer.setPreferredSize ( imageSize );
    setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
    else
    System.err.println ("Error : Cannot get current video format");
    invalidate();
    pack();
    return ( true );
    else
    System.err.println ("Error : Could not get visual component");
    return ( false );
    else
    System.err.println ("Error : Cannot create player");
    statusBar.setText ( "Cannot create player" );
    return ( false );
    else
    System.err.println ("Error : No MediaLocator for " + webCamDeviceInfo.getName() );
    statusBar.setText ( "No Media Locator for : " + webCamDeviceInfo.getName() );
    return ( false );
    catch ( IOException ioEx )
    statusBar.setText ( "Connecting to : " + webCamDeviceInfo.getName() );
    return ( false );
    catch ( NoPlayerException npex )
    statusBar.setText ("Cannot create player");
    return ( false );
    catch ( CannotRealizeException nre )
    statusBar.setText ( "Cannot realize player");
    return ( false );
    else
    return ( false );
    * Dynamically create menu items
    * @returns the device info object if found, null otherwise
    public void setFormat ( VideoFormat selectedFormat )
    if ( formatControl != null )
    player.stop();
    imageSize = selectedFormat.getSize();
    formatControl.setFormat ( selectedFormat );
    player.start();
    statusBar.setText ( "Format : " + selectedFormat );
    currentFormat = selectedFormat;
    visualContainer.setPreferredSize ( currentFormat.getSize() );
    setSize ( imageSize.width, imageSize.height + statusBar.getHeight() + toolbar.getHeight() );
    else
    System.out.println ("Visual component not an instance of FormatControl");
    statusBar.setText ( "Visual component cannot change format" );
    public VideoFormat getFormat ( )
    return ( currentFormat );
    protected void setUpToolBar ( )
    toolbar = new JToolBar();
    // Note : If you supply the 16 x 16 bitmaps then you can replace
    // the commented line in the MyToolBarAction constructor
    formatButton = new MyToolBarAction ( "Resolution", "BtnFormat.jpg" );
    captureButton = new MyToolBarAction ( "Capture", "BtnCapture.jpg" );
    toolbar.add ( formatButton );
    toolbar.add ( captureButton );
    getContentPane().add ( toolbar, BorderLayout.NORTH );
    protected void toolbarHandler ( MyToolBarAction actionBtn )
    if ( actionBtn == formatButton )
    Object selected = JOptionPane.showInputDialog (this,
    "Select Video format",
    "Capture format selection",
    JOptionPane.INFORMATION_MESSAGE,
    null, // Icon icon,
    myFormatList, // videoFormats,
    currentFormat );
    if ( selected != null )
    setFormat ( ((MyVideoFormat)selected).format );
    else if ( actionBtn == captureButton )
    Image photo = grabFrameImage ( );
    if ( photo != null )
    MySnapshot snapshot = new MySnapshot ( photo, new Dimension ( imageSize ) );
    else
    System.err.println ("Error : Could not grab frame");
    * autoDetects the first web camera in the system
    * searches for video for windows ( vfw ) capture devices
    * @returns the device info object if found, null otherwise
    public CaptureDeviceInfo autoDetect ( )
    Vector list = CaptureDeviceManager.getDeviceList ( null );
    CaptureDeviceInfo devInfo = null;
    if ( list != null )
    String name;
    for ( int i=0; i<list.size(); i++ )
    devInfo = (CaptureDeviceInfo)list.elementAt ( i );
    name = devInfo.getName();
    if ( name.startsWith ("vfw:") )
    break;
    if ( devInfo != null && devInfo.getName().startsWith("vfw:") )
    return ( devInfo );
    else
    for ( int i = 0; i < 10; i++ )
    try
    name = VFWCapture.capGetDriverDescriptionName ( i );
    if (name != null && name.length() > 1)
    devInfo = com.sun.media.protocol.vfw.VFWSourceStream.autoDetect ( i );
    if ( devInfo != null )
    return ( devInfo );
    catch ( Exception ioEx )
    // ignore errors detecting device
    statusBar.setText ( "AutoDetect failed : " + ioEx.getMessage() );
    return ( null );
    else
    return ( null );
    * deviceInfo
    * @note outputs text information
    public void deviceInfo ( )
    if ( webCamDeviceInfo != null )
    Format[] formats = webCamDeviceInfo.getFormats();
    if ( ( formats != null ) && ( formats.length > 0 ) )
    for ( int i=0; i<formats.length; i++ )
    Format[] aFormat = formats;
    if ( aFormat[i] instanceof VideoFormat )
    Dimension dim = ((VideoFormat)aFormat).getSize();
    // System.out.println ("Video Format " + i + " : " + formats.getEncoding() + ", " + dim.width + " x " + dim.height );
    else
    System.out.println ("Error : No web cam detected");
    * grabs a frame's buffer from the web cam / device
    * @returns A frames buffer
    public Buffer grabFrameBuffer ( )
    if ( player != null )
    FrameGrabbingControl fgc = (FrameGrabbingControl)player.getControl ( "javax.media.control.FrameGrabbingControl" );
    if ( fgc != null )
    return ( fgc.grabFrame() );
    else
    System.err.println ("Error : FrameGrabbingControl is null");
    return ( null );
    else
    System.err.println ("Error : Player is null");
    return ( null );
    * grabs a frame's buffer, as an image, from the web cam / device
    * @returns A frames buffer as an image
    public Image grabFrameImage ( )
    Buffer buffer = grabFrameBuffer();
    if ( buffer != null )
    // Convert it to an image
    BufferToImage btoi = new BufferToImage ( (VideoFormat)buffer.getFormat() );
    if ( btoi != null )
    Image image = btoi.createImage ( buffer );
    if ( image != null )
    return ( image );
    else
    System.err.println ("Error : BufferToImage cannot convert buffer");
    return ( null );
    else
    System.err.println ("Error : cannot create BufferToImage instance");
    return ( null );
    else
    System.out.println ("Error : Buffer grabbed is null");
    return ( null );
    * Closes and cleans up the player
    public void playerClose ( )
    if ( player != null )
    player.close();
    player.deallocate();
    player = null;
    public void windowClosing ( WindowEvent e )
    playerClose();
    System.exit ( 1 );
    public void componentResized ( ComponentEvent e )
    Dimension dim = getSize();
    boolean mustResize = false;
    if ( dim.width < MIN_WIDTH )
    dim.width = MIN_WIDTH;
    mustResize = true;
    if ( dim.height < MIN_HEIGHT )
    dim.height = MIN_HEIGHT;
    mustResize = true;
    if ( mustResize )
    setSize ( dim );
    public void windowActivated ( WindowEvent e ) { }
    public void windowClosed ( WindowEvent e ) { }
    public void windowDeactivated ( WindowEvent e ) { }
    public void windowDeiconified ( WindowEvent e ) { }
    public void windowIconified ( WindowEvent e ) { }
    public void windowOpened ( WindowEvent e ) { }
    public void componentHidden(ComponentEvent e) { }
    public void componentMoved(ComponentEvent e) { }
    public void componentShown(ComponentEvent e) { }
    protected void finalize ( ) throws Throwable
    playerClose();
    super.finalize();
    class MyToolBarAction extends AbstractAction
    public MyToolBarAction ( String name, String imagefile )
    // Note : Use version this if you supply your own toolbar icons
    // super ( name, new ImageIcon ( imagefile ) );
    super ( name );
    public void actionPerformed ( ActionEvent event )
    toolbarHandler ( this );
    class MyVideoFormat
    public VideoFormat format;
    public MyVideoFormat ( VideoFormat _format )
    format = _format;
    public String toString ( )
    Dimension dim = format.getSize();
    return ( format.getEncoding() + " [ " + dim.width + " x " + dim.height + " ]" );
    class MySnapshot extends JFrame
    protected Image photo = null;
    protected int shotNumber;
    public MySnapshot ( Image grabbedFrame, Dimension imageSize )
    super ( );
    shotNumber = shotCounter++;
    setTitle ( "Photo" + shotNumber );
    photo = grabbedFrame;
    setDefaultCloseOperation ( WindowConstants.DISPOSE_ON_CLOSE );
    int imageHeight = photo.getWidth ( this );
    int imageWidth = photo.getHeight ( this );
    setSize ( imageSize.width, imageSize.height );
    final FileDialog saveDialog = new FileDialog ( this, "Save JPEG", FileDialog.SAVE );
    final JFrame thisCopy = this;
    saveDialog.setFile ( "Photo" + shotNumber );
    addWindowListener ( new WindowAdapter()
    public void windowClosing ( WindowEvent e )
    saveDialog.show();
    String filename = saveDialog.getFile();
    if ( filename != null )
    if ( saveJPEG ( filename ) )
    JOptionPane.showMessageDialog ( thisCopy, "Saved " + filename );
    setVisible ( false );
    dispose();
    else
    JOptionPane.showMessageDialog ( thisCopy, "Error saving " + filename );
    else
    setVisible ( false );
    dispose();
    setVisible ( true );
    public void paint ( Graphics g )
    g.drawImage ( photo, 0, 0, getWidth(), getHeight(), this );
    * Saves an image as a JPEG
    * @params the image to save
    * @params the filename to save the image as
    public boolean saveJPEG ( String filename )
    boolean saved = false;
    BufferedImage bi = new BufferedImage ( photo.getWidth(null),
    photo.getHeight(null),
    BufferedImage.TYPE_INT_RGB );
    Graphics2D g2 = bi.createGraphics();
    g2.drawImage ( photo, null, null );
    FileOutputStream out = null;
    try
    out = new FileOutputStream ( filename );
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder ( out );
    JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam ( bi );
    param.setQuality ( 1.0f, false ); // 100% high quality setting, no compression
    encoder.setJPEGEncodeParam ( param );
    encoder.encode ( bi );
    out.close();
    saved = true;
    catch ( Exception ex )
    System.out.println ("Error saving JPEG : " + ex.getMessage() );
    return ( saved );
    } // of MySnapshot
    public static void main (String[] args )
    try
    JWebCam myWebCam = new JWebCam ( "TimeSlice Web Cam Capture" );
    myWebCam.setVisible ( true );
    if ( !myWebCam.initialise() )
    System.out.println ("Web Cam not detected / initialised");
    catch ( Exception ex )
    ex.printStackTrace();
    when I run it I get the following errors
    BufferToImage cannot convert buffer
    could not grab frame
    pls help

    Do you expect anyone to read this?
    http://forum.java.sun.com/help.jspa?sec=formatting
    By the way, you have a condition that makes it print those messages. Check why that condiiton isn't rue.

  • Capturing data from a RS232 device

    how do I capture data from an RS232 device to my APEX application. Precisely, I am using a barcode scanner and I need to know how to get the barcode data into an item (say P12_barcode) in my application. I have tried the keyboard wedge and the problem is that I have to set the input focus each time I need to collect the barcode of an item, so I have to switch to RS232 mode but how do I get this barcode data now?
    Please HELP...

    Thanks a trillion for this reply! wether your reply was helpful is an understatement in this matter!
    That is the type of Barcode scanner I am using man... they call it USB Keyboard emulation. It scans into note pad, word processors and text items freely.
    In my design for a solution to this problem, I have on paper, your type of solution but I lack the ability to set the focus on the desired Text Field when my cash_sales page loads.
    Secondly you said "I did have to set it to include a "Enter" after each scan" that touched upon another bug in me: I had always wanted the form to submit after each scan so that my procedure can use it against the items database and display the item in my Current Transaction Report. How did you set it to include a "Enter" after each scan? Is it on the scanner or at the page item level?
    Precisely I am using Metrologic MS9520 barcode scanner a.k.a Honeywell MS9520 barcode scanner!
    If I can set a cursor in my Px_Barcode text item after loading my CASH_SALES page and automatically submit the page after a scan(without clicking any button) then my nightmare is over...and you become my Virgo 2009 Hero.
    Happy September :)

  • Capture Audio from Mic

    I am new to Java and need to know where to start with developing a Java app that can capture audio from a pc's mic, convert it to mp3, name the audio, and store it in a directory of my choosing. Additionally, I'll need an interface to that audio app that can receive function calls and args from a windows-based application.
    Can you point me in the right direction- sample code if possible.
    Thanks,
    Jeff

    I have the same problem. There doesn't seem to be any sample code for capturing an audio recording with JMF! I have browsed the web, the usenet groups and the (physical) library. It's almost like they try to keep it secret :/
    There is plenty of information on how to use the JMF player, though.

  • Add-on to capture videos from internet that don't have a download link.

    Is there an add-on to capture videos from internet that don't have a download link. I am on a Mac.

    In general, you don't need drivers for camcorders on Macs, and the .exe file you downloaded is a Windows program, which won't run on a Mac unless you also have Windows installed.
    It would help a lot if you tell us the exact model camcorder you are using, and what application you want to use it with.
    Regarding iTunes, the latest version is iTunes 11.  You need to have OS X 10.6.8 or later to install iTunes 11.  Your profile says you have OS X 10.4.11, which is a much older version of OS X, so you won't be able to install iTunes 11.  (Here are the iTunes 11 specs.)

Maybe you are looking for

  • How to use more than one connection pool to 2 different databases ??? (Weblogic 5.1)

    Hello, In my application, I must use two different databases to retrieve informations... My application use EJB so I created two pool of connection named pool1 and pool2... But when I yet used the pool1 to connect to first database and I try to use t

  • Error in installing Jukebox Zen Xtra Dri

    ) My PC does not recognize my Nomad Jukebox following installation of Windows Media Player .2) I reinstall latest driver with no success.3) I updated driver from Device manager (because its marked with the exclamation mark) and I get an error that th

  • Is there a way to prevent Software updates to automatically upgrade my printer drivers?

    Hi everybody! Is it possible to prevent Mountain Lion to automatically upgrade my printer drivers? I'm using an iMac with Mountain Lion at work, and for my printer to work, I need to keep an older version of xerox drivers (newer versions are not supp

  • Air for Android no video playback controls

    Hi there I'm using Flash Professional CS5.5 I'm currently developing a Android app, I've imported a video clip using the import video wizard. I've tested it by publisihng it to my Android device, the video clip plays fine but there are no play/pause

  • Dead pixels appeared on my retina display. Can it be repaired?

    My MacBook Pro Retina is a little over 10 months old, and recently, two areas of dead pixels have shown up on the screen.  I have no idea what made them appear, as I baby this machine much more than my prior original MacBook Pro (7 mostly problem-fre