Help me !!!how to use a DataSource to play and save at the same time??

I create a DataSource :
DataSource ds = Manager.createDataSource(new MediaLocator("rtp://192.168.2.195:10000/audio"));
use this DataSource to create a cloneable DataSource:
ds = Manager.createCloneableDataSource(ds);
use this cloneable DataSource to create two datasource "saveDataSource" and "playDataSource",playDataSourceis used to play,saveDataSource is used to save;
DataSource playDataSource = ((SourceCloneable)ds).createClone();
DataSource saveDataSource = ((SourceCloneable)ds).createClone();
Player player = Manager.createRealizedPlayer(playDataSource);
player.start();
but i can not hear anything ,if i use ds to create a player ,i can hear the voice.
who can help me ,THX

Thanks you ,now I can play with a clone dataSource ,but i also have a problem about how to save the voice to a local file .
MediaLocator audioFile = new MediaLocator("rtp://192.168.2.210:"+audioPort+"/audio");
                         DataSource ds = Manager.createDataSource(audioFile);
                         Processor processor = null;
                         processor = Manager.createProcessor(ds);
                         processor.configure();
                       boolean result = waitForState(processor, processor.Configured);
                       if (result == false)
                           System.err.println("configuring failed");
                       processor.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
                       processor.realize();
                       result = waitForState(processor, processor.Realized);
                       if (result == false)
                           System.err.println("realizing failed");
                       processor.start();
                       ds = processor.getDataOutput();
                       DataSource playDataSource = Manager.createCloneableDataSource( ds );
                       String type = com.sun.media.MimeManager.getMimeType("wav");
                       type = ContentDescriptor.mimeTypeToPackageName(type);
                       Processor saveProcessor = Manager.createRealizedProcessor(new ProcessorModel(ds,null,new FileTypeDescriptor(type)));
                       Player player = javax.media.Manager.createPlayer(playDataSource);
                       DataSink dsink = Manager.createDataSink(saveProcessor.getDataOutput(), new MediaLocator("file://D:/record/1234.wav"));
                         System.out.println();
                         System.out.println("-> Playing file '" + audioFile + "'");
                         System.out.println("   Press the Enter key to exit");
                         player.start();
                         dsink.open();
                         dsink.start();
                         saveProcessor.start();i can save a file ,but it can not play.

Similar Messages

  • How can I delete email from iPhone and ipad at the same time

    How can I delete emails on my iPhone and ipad at the same time

    Use IMAP Mail e.g. Gmail

  • Can I use DisplayPort (for a monitor) and Thunderbolt at the same time?

    Hi all,
    I have a mid 2011 MacBook Air 13 inch with a single Thunderbolt port.
    I have the Apple Mini DisplayPort to Dual-Link DVI Adapter cable which I am able to use to run a Dell 24 inch monitor - this cable connects to both the DisplayPort/Thunderbolt port and also a USB port on the Air.
    I want to be able to run this Dell monitor, and also run a Thunderbolt hard drive - one with 2 Thunderbolt ports.
    Is this possible?
    Can I connect the DisplayPort part of the cable to the pass-through Thunderbolt port on the hard drive, and then connect the hard drive to the Thunderbolt port on the Air?
    Thanks, for any advice :-)
    I would like to buy the Apple Thunderbolt display (which would solve this issue), but I suspect it will may refreshed soon. So I don't intend to get one until then.
    Thanks :-)

    OK,
    I have tried this myself and it does work.
    Macbook Air - connect to Seagate GoFlex Thunderbolt (Using Thunderbolt cable)
    Seagate Goflex Thunderbolt passthrough to a Dell 24 Inch monitor (using Apple Mini DisplayPort to Dual-Link DVI Adapter cable).
    Both the Seagate GoFlex and the Dell 24 inch monitor work :-)
    I am happy with this result, so I won't need to get a Thunderbolt moniter just yet - I will wait for Gen 2 :-)

  • Using iPod both in Windows and Mac at the same Time?

    I was wondering if it was possible to use my brand new ipod both in Mac as in Windows without having to format or restore it every time?
    The idea is to use "manually manage songs" on both Operating Systems.
    Thanks for your help!

    iPods come formatted Windows and will work on Macs and Windows. Unless you Restore it in a Mac, it will stay formatted Windows.
    If it doesn't work, put the iPod on Disk Mode and iTunes should recognize in both systems.
    If it is formatted Mac, it will not be useable on Windows, even in Disk Mode.

  • How do i delete sections of video and audio at the same time

    hello, i made a video with sound and overlapping voiceover i want to know how do i delete a section of the video and the voice over without having to resynch everything again?

    In Final Cut Pro X, this is easy. You drag to select all these clips. Then use the Blade Tool.
    However, in iMovie, it is not as straightforward. You can edit the camcorder clip and its audio, but any music tracks, voiceover tracks, etc. will not be edited with it.
    A workaround is to use the SHARE menu to SHARE/EXPORT TO QUICKTIME using Apple Intermediate Codec to retain as much quality as possible. Then import this new movie into an Event. New all the audio is married to the video and you can edit everything together.

  • Recording vocals and guitar at the same time, using the Alesis IO dock!

    Hi there!
    I have an Ipad 2 with the newest OS installed etc. And I rea the other posts in here.
    I bought an IO dock from Alesis the other day and was full of exspectations, but I got a bit disappointed -> Garageband! When I bought the Ipad dock I exspected that I would be able to record (or just play and hear the inputsound from two devices) at the same time in my headphones! But I wasn't... Now I'm wondering if this is going to be fixed in an update or not? I think it would be a shame if this issue isnt adressed, due to the huge abilities the Ipad/garageband/Ipad docks withhold.
    So anyone know anything? I went to my musicstore and spent about an hour or so with the tech dude there trying dfferent setups, but unfortunatly without luck! Just to clarify that I didt just plugged in my guitar and got mad that it wasnt apple intuative!
    Hope someone can help :)

    I am wondering if I can record audio and midi at the
    same time in Logic 7 Express. I am running my guitar
    thrugh a Roland GR 33, and a line out and using the
    GR 33 to trigger sounds in the Logic's synth section
    but cant seem to record all three tracks at once. If
    any one knows how let me know. Oh and I am running
    the GR Synth and Guitar into the Prosonus Fire Fox
    and have the GR 33 out midi to the Fire Box as well.
    So I guss the question is how do I sent up two audo
    tracks and one midi track to record in real time.
    Thanks Victor
    Try arming the audio tracks, select one of the tracks, then while holding down the shift key, select the midi track you want to record, arming the "r" on the midi track. Press "record".....
    HL

  • Use one external harddrive on both pc and mac at the same time

    i bought an iomega external harddrive today
    can i use it on both mac and pc at the same times?
    for ex:
    when i plug in both computer
    i could able to read and write on the hdd on both computer
    since i format it into 4 partitions (2 journal and 2 doc)
    so i wish i can use them separately in 2 computers

    Hi Jerry_L and welocme to Discussions,
    using such USB or Firewire connected external harddrives with two computers at the same time is usually not recommended by the manufacturer.
    Doing so might lead to data-loss and the like.
    Check with the manual of that harddisk to verify.
    Using it with one computer at a time with your partitioning should be doable.
    Regards
    Stefan

  • My Ipad mini does not see my printer. my wife's ipad2 does. We both use IOS8 and upgraded at the same time. How can I remedy this?

    My Ipad mini does not see my printer. my wife's ipad2 does. We both use IOS8 and upgraded at the same time. How can I remedy this?

    OK great info!
    I found 2 possible ethernet to USB adapters:
    By "Plugable":  USB 2.0 to ethernet LAN wired network adapter - seems this will work, but I'll contact Plugable.
    2. Apple USB Ethernet Adapter
    Easily connect your MacBook Air computer to an Ethernet network with the Apple USB Ethernet Adapter. Small and light, it connects to the USB 2.0 port of your MacBook Air and provides an RJ-45 connector that supports 10/100BASE-T performance.  BUT NOT SURE IF THIS WILL WORK ON ANYTHING BUT a MacBook Air…
    One person commented: 
    This little gem used to be the device of choice for adding a second Ethernet interface to a Mac Mini Server and I'd been using one that way for about a year. After doing a software update to 10.6.6 it stopped working. Forewarned is forearmed – it appears that Apple is finally enforcing the MacBook Air system requirement.
    Thanks for any additional comments.
    Best regards,
    Steve Schulte
    Sunday 6 January 2013

  • Datasocket help, want to use the same(one .ocx only) in VB and HTML at the same time

    I want to create one ActiveX control that can be use in VB and HTML. My control will consist 1 CommandButton, 1 TextBox and 1 Label.
    My Objective is to have real time data passing between the same control which will be used at VB and HTML at the same time.
    For example, from HTML if I click a button, the text at textbox at HTML will be pass to the label at VB at the same time. And vice versa where when button at VB is click, the text at textbox at VB will be pass to the label at HTML.
    Help me.

    Hello Sam R.,
    The ActiveX will be written in VB6 with Measurement Studio6. It's some sort of tutorial lesson for me to test the capability of DataSocket.
    I want to create 1 control which will act as reader and writer. I am using Windows XP with IIS as web server and testing using 1 open VB6 Form with the control and 1 HTML file with the control using Data Socket Server with dstp://localhost/something. I dont know whether I need to have the script or not, what ever can do. tell me if it is the way to do. If it can be program directly in the control is better.
    Basically, yes. the command button inside the control should updates both label and textbox.
    If you can say that 1 datasocket control is enough, I will follow your advice because you are the expert. 
    I try before by using the example in DSReader and DSWriter but I cannot do the 'real time' updating when I click either button in VB6 or HTML page. It can only updated when I click again the commandbutton and     

  • Ok i need to unlock my ipod but i don't know my password i use itunes but i need to update at the same time this srcews up the itunes and i have to restart the computer i need to restore the ipod please help

    ok i need to unlock my ipod but i don't know my password i use itunes but i need to update at the same time this srcews up the itunes and i have to restart the computer i need to restore the ipod please help

    Connect the iOS device to your computer and restore via iTunes. Place the iPod in Recovery Mode if necessary to allow the restore.
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    Maybe here:
    Trouble installing iTunes or QuickTime for Windows
    iOS: Device not recognized in iTunes for Windows
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP

  • Can we use both INSERT and UPDATE at the same time in JDBC Receiver

    Hi All,
    I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
    user send the file which contains both new and old record and I need to save those in MS SQL database.
    If the record exist then use UPDATE otherwise use INSERT.
    I looked on sdn but didn't find any blog which perform both the things at the same time.
    Interface Requirement
    FILE -
    > PI -
    > JDBC(INSERT & UPDATE)
    I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
    Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
    Thanks,

    Hi ,
              If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
    "If the record exist then use UPDATE otherwise use INSERT."
    Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ...  where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows  you proceed with "insert into tablename....." since there are no old records present in database.
      Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database.  A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server.   If you need further help on how to write and call stored procedure in MS SQL you can look into these links
    http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
    http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
    [ This part you can ignore, Since its not sure that you will face this situation
        Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
    http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
    http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
    http://www.faqs.org/docs/ppbook/r27479.htm
    http://msdn.microsoft.com/en-US/library/ms187373.aspx
    http://msdn.microsoft.com/en-US/library/ms173763.aspx
    http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
    http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
    http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
        There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
    regards
    Anupam

  • Can I use a camera for application in Labview and VBAI at the same time ?

    Dear all,
    I'm trying to save an AVI file with Labview and make an image process with VBAI at the same time, in one machine.
    The error : "Camera already in use" displayed.
    My Camera is a GIGE and I work with Imaqdx. I've test the multicast mode but it only operate with several machines.
    How can I do this ?
    Thank's to help me,
    Yoann B

    I'm not necessarily saying that.  It's been a while since I've used VBAI, so I don't remember all of the capabilities, but if VBAI can do the inspection and recording at the same time, you should be fine.
    The trick is that only one program can access the camera at the same time.  That application reserves the camera, thus making it unavailable to others.
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • My SB Audigy 2 card can't use headset and musicamplifier at the same time

    Hi, i just bought a SB Audigy 2 [D400] and i have downloaded drivers and programs. I run Windows XP SP2.
    The soundcard works fine but it is very very annoying that i physically have to change the jack in the green=line out jack from headset to musicamplifier when i want to use my musicamplifier and change back the jack in the green=line out from musicamplifier to headset when i just want to use the headset/headphones .
    In the shop they told my that i can connect both amplifier and headset at the same time and then with creative software control whether there is sound in the headset or in the amplifier. But i can't simple get it work.
    I tried to use the green to the amplifier and the headset/speakers in the black (line out 2) and then with creative speaker settings softeware choose headphones but still the ampliefier receive the sound and no sound in the headphones. Why? In fact no matter what configuration i try the headphones doesn't work.
    But if i change the jacks so headset is in the green line out then only headset is working and the amplifier doesn't work no matter i put it in sort=line out 2 jack or orange=line out 3 jack.
    Can somebody here tell me if it is possible or not to connect both headset and external amplifier and control by software which to play? and how?
    please help, thx.
    Michael

    If you can have an ASIO compatible music playing system, then it might be possible to have system like you wish when using Creative Audigy 2 card. Since ASIO bypasses Windows Audio System, you can use both 'drivers' (ASIO - WDM/MME/DS) side by side.
    Say you want to play a game (using headset /w mic) and someone other like to listen music at the same time. With ASIO capable system you can output your music for example to "center L/R (stereo) channels" and same time output sounds from other source (using MME/DS/WDM drivers) to normal output channel (Front L/R). Only thing is, you need to set your speakersystem to 4 or 6 (depending which other channel you're using) (and for better 'balance' to adjust "angle" on THX console. You get the THX console by installing Audigy 2 Zs software).
    Try for example http://img332.imageshack.us/img332/463/djs9mo.jpg[/img] width="406" alt="Image Hosted by ImageShack.us" >
    Another option:
    Say you want to play music through external amplifier and play game online with your headset + microphone (eg. others but you listen the music, you play games)
    --> try free http://img332.imageshack.us/img332/4589/tbp7rz.jpg[/img] width="406" alt="Image Hosted by ImageShack.us" >
    If you use ASIO on BeatPort Player you can select L/R individually from the list(s). Same rules as described earlier.
    = You can play from 2 different sources simultaoneusly (ASIO + WDM/MME/DS) to two different outputs without disturbance. The other (WDM/MME/DS) source is set 'automatically' output to (Audigy) "green" port, and the other (ASIO) to "black" or "orange" port (as set).
    .jtpMessage Edited by jutapa on 09-5-2005 05:30 AM

  • How can I delete photos from my iPad, iPhone, and laptop at the same time?

    How can I delete photos from my iPad, iPhone, and laptop at the same time so I don't have to do it separately on each device?

    Photos that were synced from your computer using iTunes can only be deleted by de-selecting them from the folder from where they were synced -  and then re-syncing.
    Connect the iPad to the PC and launch iTunes.
    Click on the iPad name on the left side under devices.
    Click on the Photos Tab on the right.
    If you want to remove all of the Photos - uncheck the Sync Photos from Heading
    Click on Apply in the lower right corner of iTunes
    If you are using iTunes 11 - this will be helpful, Setting up syncing in Windows.
    http://support.apple.com/kb/PH12313

  • How to record midi and audio at the same time?

    Hello,
    I have a Roland sh-201 synth and Logic 9. When I use patches from the sh-201, it will record it via audio. What if I wanted to record the audio but also have the midi information as well? How would I be able to accomplish this? My synth is connected via USB which carries both midi and audio. Sorry for my poor english, but any help would be greatly appreciated.
    Thank You.

    Hi
    Logic will record both audio and MIDI at the same time, but you *MUST* have the Software Instrument/MIDI track selected in the Arrange Track List.
    The audio track must be 'Record Ready':
    HTH
    CCT

Maybe you are looking for