Capturing voice to file

kindly can someone help me...
i am using the following code to save my voice from microphone....
it is not working...can some one check it.......
import java.net.*;
import javax.media.*;
import javax.media.protocol.*;
import java.util.*;
import javax.media.format.*;
import java.io.*;
public class TestJMF3 implements ControllerListener{
     public static void main(String args[]){
          new TestJMF3();
     boolean realized;
     boolean configured;
     TestJMF3(){
          realized = false;
          configured = false;
          String t="f:/voice.wav";
          try{
               Vector v=CaptureDeviceManager.getDeviceList(new AudioFormat("linear", 44100, 16, 2));
               CaptureDeviceInfo info=(CaptureDeviceInfo)v.elementAt(0);
               Processor p=Manager.createProcessor(info.getLocator());
               p.addControllerListener(this);
               p.configure();
               while (! configured) {
                    try {
                         Thread.currentThread().sleep(100L);;
                    } catch (InterruptedException e) {
                         // ignore
               p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.WAVE));
               p.realize();
               while (! realized) {
                    try {
                         Thread.currentThread().sleep(100L);;
                    } catch (InterruptedException e) {
                         System.out.println(e);
               DataSource output = p.getDataOutput();
               DataSink sink = Manager.createDataSink(output, new MediaLocator("file:///"+t));
               sink.open();
               sink.start();
               p.start();
          }catch(Exception e){
               System.out.println(e);
     public synchronized void controllerUpdate(ControllerEvent evt) {
          if (evt instanceof RealizeCompleteEvent) {
               System.out.println("r");
               realized = true;
          else if (evt instanceof ConfigureCompleteEvent) {
               System.out.println("c");
               configured = true;
          //else if (evt instanceof EndOfMediaEvent) {
               //System.exit(0);
          else {
               // System.out.println(evt.toString()+"pakistan");
}

You have only one problem. You must specify create DataSource for capture data, set new track formats to it, and then create Processor from DataSource.
You can find formats that you can capture from from JMStudio. There you can try to capture audio with many formats, with some formats you will not be able to play processor the others will play normally. Last ones you can use to set to DataSource of your capture device!!!
Best,

Similar Messages

  • Screen Capture/Voice Record eCourses

    I'm looking to create eCourses using screen capture/voice record. Would Adobe Captivate 7 be my best option? Would I have to purchase this software seperatly or does Creative Cloud have something I could use for this?
    Thanks!

    Hi there
    I read your post. I use Snapz Pro X too, and I was surprised to learn it doesn't work with Keynote. Here's a possible work around.
    Record your voice-over on any recorder and export to itunes or if you have sound studio loaded on your mac, use it. From the inspector you can access you voice-over for use in your project.
    I've recorded a voice-over in sound studio for a keynote project. From sound studio I export to my desktop. From the desktop I drag and drop the audio onto the slide I need the voice-over on. This works well for me. try it.
    Once you've got it set the way you like, export the Keynote project to QT or whatever format you like. In QT, the project will play like a movie. You can save the file, burn to a disk, or post to a web page.
    I hope this helps
    Carl

  • Stopping playback while capturing voice..?

    hi,
    when i try to capture voice in WTK its getting playedback automatically.how can i stop this?
    thanx

    i am having the same problem my code is below..
    when the phone is recording something it automatically plays back what it records..
    and i dont want this to happen,
    i want it to only capture and save the voice.. not play it back..
    this code is for saving captured audio and listening to
    what you record afterwards actually,
    but i modified it a little in order to prevent repeating of the record
    but i still hear my voice played back after capturing and i want to stop it.
    i just want to record my voice to a file..
    i dont want the phone to play it after capturing my voice..
    package com.apress.chapter8;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.media.*;
    import javax.microedition.media.control.RecordControl;
    public class SaveCapturedAudioMIDlet extends MIDlet
    implements CommandListener {
    // the display items
    private Display display = null;
    private Alert alert = null;
    private Command exitCommand = null;
    // players and controls
    private Player capturePlayer = null;
    private RecordControl rControl = null;
    private boolean error = false;
    public SaveCapturedAudioMIDlet() {
    // create the display
    display = Display.getDisplay(this);
    alert = new Alert("Message");
    alert.setTimeout(Alert.FOREVER);
    alert.setString("Capturing for 10 seconds. Say something intelligent!");
    exitCommand = new Command("Exit", Command.EXIT, 1);
    alert.addCommand(exitCommand);
    alert.setCommandListener(this);
    try {
    // create the capture player
    capturePlayer = Manager.createPlayer("capture://audio");
    if (capturePlayer != null) {
    // if created, realize it
    capturePlayer.realize();
    // and grab the RecordControl
    rControl = (RecordControl)capturePlayer.getControl(
    "javax.microedition.media.control.RecordControl");
    // set the alert as the current item
    display.setCurrent(alert);
    // if it is null throw exception
    if(rControl == null) throw new Exception("No RecordControl available");
    // and set the destination for this captured data
    rControl.setRecordLocation("file:///test.wav");
    } else {
    throw new Exception("Capture Audio Player is not available");
    } catch(Exception e) {
    error(e);
    public void startApp() {
    if(error) return;
    try {
    // first start the corresponding recording player
    capturePlayer.start();
    // and then start the RecordControl
    rControl.startRecord();
    // now record for 10 seconds
    Thread.sleep(10000);
    // stop recording after time is up
    rControl.stopRecord();
    // commit the recording
    rControl.commit();
    // stop the Player instance
    capturePlayer.stop();
    // and close it to release the microphone
    capturePlayer.close();
    // finally, create a Player instance to playback
    // check your device documentation to find out the root.
    // The following will work on devices that have the root
    // specified as shown
    // and start it
    } catch(Exception e) {
    error(e);
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
    if(capturePlayer != null) capturePlayer.close();
    public void commandAction(Command cmd, Displayable disp) {
    if(cmd == exitCommand) {
    destroyApp(true);
    notifyDestroyed();
    // general purpose error method, displays on screen as well to output
    private void error(Exception e) {
    alert.setString(e.getMessage());
    alert.setTitle("Error");
    display.setCurrent(alert);
    e.printStackTrace();
    error = true;
    }

  • Voice Memos File management with wireless remote hard drive

    Dragging unwanted voice memos from within iTunes application to trash, then emptying trash, won't delete voice memos in the "voice memos" folder in iTunes Media on my external remote hard drive. Why not?
    I manage my iTunes music from my laptop, storing the actual files in an iTunes Media folder on a hard drive connected to an Airport Extreme. The hard drive was close to full and I decided the culprit was giant voice memo files. I didn't need most of them so I dragged them to the trash from within the voice memos "playlist" in iTunes. This removed them from the playlist, but even when I emptied the trash via the Finder pull down menu, the files stayed in the actual folder on the hard disk. Disk still full. What gives?

    Hi Samboni98, and a warm welcome to the forum!
    You could do that, but a far better idea would be to clone the 160 to the 500, then boot from the 500 which besides beimg faster, OSX just loves lots of Free space.
    Get carbon copy cloner to make an exact copy of your old HD to the New one...
    http://www.bombich.com/software/ccc.html
    SuperDuper...
    http://www.shirt-pocket.com/SuperDuper/
    After cloning bootup with the Option key held down & choose the 500!

  • How to get the words in an opened but unsaved Voice board file?

    I'm using the software named ViaVoice from IBM, which can change the voice from the computer's microphone to text, and display the words on the Voice board file that the software provides.(See attachment)
    Each time the user speaks two words to microphone, the Voice board displays these words on it(but doesn't save the words in the file automatically). I want to get the words into LabVIEW after the user finished speaking everytime.
    For example, in my application, I want to control a car by user's voice, once the user speaks "to Left", the voice board displays " to Left" on it, LabVIEW reads the voice board file every 2 seconds, once LabVIEW finds the number of words changed, it reads the last two words and does the corresponding task.
    The problem is that how can I get the words into LabVIEW from the Voice board? I can pre-run the ViaVoice, pre-open the Voice board, and pre-save the Voice board as a .doc file or a .txt file, But the ViaVoice can’t save the doc/txt file antomatically as the speaker adds new words on. What should I do?

    the attachment

  • How to capture the excel file name

    Hi friends,
    when i execute my program one excel sheet is getting generated.for this i have used a fm 'SAP_CONVERT_TO_XLS_FORMAT'.i want to capture that excel file name and i want to pass it to next function module as input.bcz i should not do any hard coding like passing the filename directly into the function module.
    anybody have any suggestion for this.

    Hi,
    Here is the piece of code ....
    I hope this will add some help to u...
    FORM convert_xls_itab.
      break devuser.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_field_seperator    = 'X'
          i_line_header        = 'X'
          i_tab_raw_data       = wa_tab
          i_filename           = p_file
        TABLES
          i_tab_converted_data = it_data
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = P_FILE
    I_BEGIN_COL = P_BEGCOL
    I_BEGIN_ROW = P_BEGROW
    I_END_COL = P_ENDCOL
    I_END_ROW = P_ENDROW
    TABLES
    INTERN = IT_INTERN.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    **--- Perform to move the data into an internal data
    ENDFORM. " CONVERT_XLS_ITAB
    Thanks & Regards
    Ashu Singh

  • I have my photos  iPhoto but my iPhoto library is empty. when clicked message reads could not be opened image capture cannot open files in the photo library format. How do I get my photos back into my library?

    I have my photos in  iPhoto but my iPhoto library is empty.When clicked message reads could not be opened image capture cannot open files in the photo library format. How do I get my photos back into my library?

    When what is clicked?
    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • Image Capture creating zip files instead of regular files

    I've been using Image Capture for many years. For some reason, all of a sudden, all my scans are being put into a zip file instead of as a regular file. I'd like to have Image Capture make regular files again such as pdf etc.  What do I do?
    Does this have anything to do with going to OS Yosemite 10.10?

    Hi
    appzapper & such are pretty flaky at removing things usefully, imo.
    Use the uninstaller for speed download - http://www.yazsoft.com/products/speed-download/faqs/?how-to-un-install-speed-dow nload-properly
    or get a hold of FindAnyFile or easyfind & search for Growl & Speeddownload & yazsoft - but from all I hear, the uninstaller works fine.
    Failing that, Safari's settings plist file isn't in caches
    Home/Library/Preferences/com.apple.safari.plist
    is the place
    & if you're still stuck, test & maybe download another browser using a New User Account.

  • How to capture path and file info in a JSP?

    Hi, I am developing an JSP in which I am trying to capture the path and file name that I can then write into a database entry.
    For example in MS word when you do file > open a box pops up that you can navigate to the required folder and then click on the file you wish to open.
    I would like to do something like that usign JSP.
    Is this possible?
    If so is there a particular java package I need to import in my JSP and what class would I use to add the file box.
    I am thinking that I would put a button in the JSP which the user clicks on to open the box. When they select the required file and click OK somehow my JSP then captures that path/file name and I can use it in an SQL statement to write to the database.
    Any suggestion would be great thanks.
    Jason.

    All you want is to upload a file from the client to the server, right?
    Google around using keywords jsp+file+upload and you'll get lot of results [1]. The Apache Commons FileUpload [2] is a commonly used one.
    [1] http://www.google.com/search?q=jsp+file+upload
    [2] http://commons.apache.org/fileupload/

  • How to capture a .gif file from a spectrum analyzer and save the file in PC

    I want to capture a .gif file from a spectrum analyzer and save the file in PC, but I've got a problem when read data from the instrument. I'm not sure how to format the string got from the instrument , When I use "%s" or "%t" as the read string format the data got from the instrument is truncated.
    my code are as follows, could anyone tell me where i am wrong?
    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
     viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%t", resultsArray);
     printf("%s", resultsArray);
     getchar();       
    Solved!
    Go to Solution.
    Attachments:
    readResult.docx ‏50 KB

    char resultsArray[5000];
    viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
    viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%b", resultsArray);

  • Captured AVI type2 files shown up short after imported in CS3 PremierePro

    Am a new user with On Location 3.0.159. Have encountered strange issues to the AVI type 2 files record via through 1394 from DVcam Deck Playout in slave mode. When clips imported to CS3 Premiere Pro, files read only 10' only on the time line as rest of files looks as cut out and missing where the original recorded clips were 28' in total. Have checked with scrubbing through DVR as both Video/Audio were fine in full 28' duration and there weren't any issues or error before the clips was ejected. Also I've checked the files with other player and they also reads 28" in full. Am I missing something?
    Currently using latest CS3 Premiere Pro 3.1.1 with XP2 platform.

    Took me couple of days nailed down where the problem was since there eren't any log's or error found nor system error as indicated.
    OnLocation/direct to disk recording has no issues at all with these files batches, it acturally does faultlessly with tape direct captured to disk as well as Camera. The reason am trying captured batch of contents that runs for more than 4hrs. And working with CS3 Premiere under AVI-1 type take much longer conforming and indexing the contents as such. So by switching with OnLocation using AVI-2 type which Premiere like reducing the confroming time by almost 1/2, due to the fact that I'm working with mixed batch of contents in the field.
    As for the issused am experiencing with these file were caused by 3rd party plug-in codec, some references already demonstrated and addressed with similiar issuses in the Premiere CS3 user forum, ref link http://www.adobeforums.com/webx/.3c064185
    After I've un-installed the 3rd party plug-in, and bin it back to Premiere CS3, and there weren't any further issues with these batched captured AVI-2 files. All shown in full faultlessly!
    Think this app really comes in handy for field user.. anyway thanks for your response..
    and now needed to re-look into these 3rd party codec.

  • I paired my old LG phone using bluetooth exchange and uploaded all of the Voice Memo files from it to my macbook and I can't find the file, where would it be located ?

    I paired my old LG phone using bluetooth exchange and uploaded all of the Voice Memo files from it to my macbook and I can't find the file, where would it be located ?

    You cannot update iPhone 4 to IOS 8.1.2, the highest you can update is IOS 7.1.2.
    Unless you've iPhone 4S (looks similar to iPhone 4)

  • Capture error, Unknown File problems-..

    I am capturing to disk using “Capture Now” from a Canon GL-2, to an external drive attached to my MacBook using FCP 5.1. I have done this many times, have not had problems with it before now, and have done it again since, so I know that the system is configured correctly.
    At the end of a class I recorded, I pressed Escape to end the capture, and received the spinning ball. The computer was completely paralyzed, the mouse moved, but could not activate the dock, the clock stood still, I could not switch apps or force quit. After waiting for 15 minutes I decided to shut down by holding the power button. The resulting file from the capture was a file that contains all the info from the capture (I can tell from the file size), but since FCP could not correctly close the import, some vital information was not written to the file. This was an isolated incident, but I need the video from the capture.
    I cannot find any way to make it a recognizable file, I have tried FCP, QuickTime, Compressor, iMovie, MPEG Streamclip, and others as well. Under info, the file type says that it is a quicktime movie as it should, but the duration, dimensions and preview do not show up.
    Final Cut Pro Error message: File Error: Unknown File.
    QuickTime: Error opening movie, the movie could not be opened.
    Has anyone encountered this before? How can I recover the information from the file? The video contained in it is very important. Thank you for the help!
    MacBook   Mac OS X (10.4.7)   2.0 GHz, 2 GB Ram

    True, Canons don't do well with other firewire devices, I have discovered that out before using a different drive, but I do not think that it has anything to do with the problem in this case. As to why I can't recapture, by "capturing to disk" I meant going straight to disk, no tape, just directly into FCP from the GL-2. I thought I used the correct terminology for that, but I guess I should have been more specific. Since I can't go back in time to recapture (I'm not meaning to be sarcastic or harsh by saying it like that), I am stuck with only this corrupted file, that contains all of the video, but cannot be read (at least easily). So my only option is to somehow fix this file, extract the video, or forget about it....
    Anything else? I don't know how to find documentation about the inner-workings of these files, so if someone knows these things, or if it is even possible, please help! Thank you!

  • Voice note file conversion

    I am on Windows XP.  On the Pearl, a voice note file that is created is a .amr file.  Can I create a file more standard like an .wav or what software is recommended for the conversion for my XP machine does not recognize a .amr file?  Thank you.
    Solved!
    Go to Solution.

    Hi and welcome to the forums!
    It would be easier to get Quicktime for your XP that to change the file type of the Blackberry,
    Quicktime plays .amr files.
    Thanks,
    Bifocals
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • Configuring port mirroring on the MA561x to capture voice packets?

    How to configure port mirroring on the MA561x to capture voice packets? Now I use the MA5616. Any help would be appreciated!

    How to configure port mirroring on the MA561x to capture voice packets? Now I use the MA5616. Any help would be appreciated!
     I use the MA5616,too,and I bought from  www.huanetwork.com
    , nice price. The configuration of this problem, please visit:  http://momopp.blogdetik.com/

Maybe you are looking for

  • Mail app keeps re-caching all messages when it starts

    Hello In past 10 days i have a very big problem which gives me headaches already. The problem is ( i did not change anything!) mail.app keeps re-caching all messages and attachments everytime i start the app. I have over 40.000+ mails so you do the m

  • Unable to create a new Message  Layout : 500 attempts failed.

    I am getting this error " Unable to create a new Message Layout : 500 attempts failed." when I am trying to add my custom region to seeded Message Layout.

  • C7 issue with front camera

    I upgraded my nokia c7 to anna version, and i have been having problem with my front camera for video calling. Each time i try using the front camera, i get this reply ' unexpected error in Moderator's note: Post pulled from irrelevant thread, and su

  • NEW QuickTime 7.3.1 should solve problems with cd playback in iTunes 7.5

    FINALLY all the problems within iTunes 7.5 as described by so many users seem to be completely solved from today by the very new version of QuickTime, check for update 7.3.1! AND the cd-drive doesn't rev up so frightening any longer! AGAIN a happy Ap

  • Mac Mini (intel) don't start, power light is flashing WHITE !!!

    First sorry for my last post, i make a misstake in the color of LED, but the color is WHITE and not GREEN. Hello, yesterday i use my Mac Mini for make some Downloads, and after done i turn he off by quick press power button (i are using Windows XP PR