How to send/receive ByteArrayOutputStream

Hello, all
I am doing a project which use mobilephone to record a sound then send the sound to a server.
Now i am finishing the recording by using Player and RecordControl.
After that, i get a ByteArrayOutputStream. The code is as follow:
ByteArrayOutputStream audioOutput;
player.realize();
RecordControl rc = (RecordControl) player.getControl("RecordControl");
rc.setRecordStream(audioOutput);
rc.startRecord();
player.start();
Thread.currentThread().sleep(5000);
rc.commit();
My question is how to send this audioOutput..
Thanks for any response.
Edited by: cityukings on Jan 14, 2009 11:30 PM

Now you have the ByteArrayOutputStream, create a byte array and send it to server using Connector. See the demo..
conn = (StreamConnection)Connector.open(serviceUrl);
DataOutputStream out = conn.openDataOutputStream();
//OutputStream output = conn.openOutputStream();
out.writeInt(recordedSoundArray.length);
out.write(recordedSoundArray,0,recordedSoundArray.length);
out.flush();
out.close();
Regards,
Om

Similar Messages

  • Can anybody tell me how to send/receive  the sms from java application

    Hi All,
    Can any body tell me, how to send/receive the sms from java application to mobile phones.
    I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
    the following error.
    Cannot connect to GSM Device, error : -11

    Which jsms? Google finds several.
    Try the website where you downloaded it.

  • Can any body tell me, how to send/receive the sms from java application

    Hi All,
    Can any body tell me, how to send/receive the sms from java application to mobile phones.
    I have installed the jsms engine and when i try to connect to the mobile device ,the jsms server is giving
    the following error.
    Cannot connect to GSM Device, error : -11

    The best place to ask your question is at the JSMS website, forum or mailing list since this is no error that directly comes from a class belonging to the core Java classes.

  • How to send/receive e-mails with sql or pl/sql

    Hello,
    I must send and receive e-mail (something like e-mail client) done with oracle database and oracle forms.
    How can I receive e-mails with SQL? Is there any way?
    I read threads about using utl_smtp but i could not send an e-mail. May be I need to use servers without password?
    Best regards
    P.S. I'm using Forms 10g R2 and database 9i

    Hi,
    try below code.
    change mailhost ip to u r mail server ip.
    CREATE or REPLACE PROCEDURE SimpleTextMessage IS
    mailHOST VARCHAR2(64) := '192.168.0.21';
    mailFROM VARCHAR2(64);
    mailTO VARCHAR2(64);
    mailCONN utl_smtp.connection;
    mailDATE VARCHAR2(20);
    vreply utl_smtp.reply;
    vreplies utl_smtp.replies;
    i number;
    BEGIN
    mailFROM := '[email protected]';
    mailTO := '[email protected]';
    SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') INTO mailDATE FROM dual;
    vreply := utl_smtp.open_connection(mailHOST, 25, mailCONN);
    vreplies := utl_smtp.help(mailCONN, 'HELP');
    for i in 1..vreplies.count loop
    dbms_output.put_line( 'text = ' || vreplies(i).text );
    end loop;
    vreplies := utl_smtp.ehlo(mailCONN, mailHOST);
    for i in 1..vreplies.count loop
    dbms_output.put_line( 'text = ' || vreplies(i).text );
    end loop;
    vreply := utl_smtp.mail(mailCONN, mailFROM);
    vreply := utl_smtp.rcpt(mailCONN, mailTO);
    vreply := utl_smtp.open_data(mailCONN);
    utl_smtp.write_data(mailCONN, 'Subject: '|| 'Hi' || chr(13));
    utl_smtp.write_data(mailCONN, 'From: '||mailFROM || chr(13));
    utl_smtp.write_data(mailCONN, 'Date: '||mailDATE || chr(13));
    utl_smtp.write_data(mailCONN, 'To: '||mailTO || chr(13));
    utl_smtp.write_data(mailCONN, 'CC: '||mailFROM || chr(13));
    utl_smtp.write_data(mailCONN, chr(13));
    utl_smtp.write_data(mailCONN, 'Hello Friend how r u.' || chr(13));
    vreply := utl_smtp.close_data(mailCONN);
    END;
    /

  • How to send / receive business card from other mobile phone?

    i can't find how to send business card, like at Nokia phone.
    and i can't receive it too.
    need help .

    And when do you think we could get that feature? Very essential when exchanging contact details with people. Had I anticipated this, I would have stayed with other brands.

  • How to send/receive XML using JSP

    Hi,
    I'm new to all this JSP/XML stuff so apologies if this is trivial.
    I'm trying to send an XML file via HTTP POST using JSP. Anyone know how to do this?
    Once the XML has been sent, how do you use JSP to request the XML file? I've figured out how to parse it already.
    Also, is it possible to call xsql directly within JSP?
    Thanks!

    I'm trying to send an XML file via HTTP POST using JSP. Anyone know how to do this?The question is, does anybody understand what you mean by this. Let me take a guess. You want to upload an XML file to a server. If this guess is right, then the answer is don't use JSP to do that. JSP is for generating output to be sent to a client. Use a servlet to handle an upload. And you don't need to write it yourself, there are already several file-upload servlets available on the web.
    Second guess: you have a POST request that asks your server to send an XML file back to the client. If it's a static XML file you don't need a JSP or a servlet or anything, just let your web server handle it just like any other static file. If it's dynamically generated then there's an answer worth giving, but I doubt that this is your question. But if it is, let us know.

  • How to Send & receive HL7v2.3 & HLv2.5.1 message from same port.

    Hi,
    Currently I have a requirement of sending multiple version HL7 messages say HL7v2.3 & HLv2.5.1 from the same port(say 3333) and receive it at the same port (say 4444) using Oracle SOA Suite.
    To address this problem, I first tried to create multiple versions endpoints in the Healthcare UI of SOA and gave them separate Composites each catering different versions of the HL7 message structure. But this didn't work since, the Healthcare UI refuses to accept two different Composites. Not sure if this supported in Healthcare UI or not?
    Also, another problem which this approach threw at me was that I have another challenge to create a single healthcare adapter to accept both versions which is not possible, i think, because when we are creating the HL7 adapter in the Composite it asks to provide the HL7 structure it follows and there can be only one message structure that I could provide to this healthcare adapter placed at the receiving end.
    With extensive googling I was pointed out to second approach of making it entirely in B2B. But there was also stuck at the time the agreement (Agreement between local partner and remote partner for both the HL7 versions) was to be deployed, since it was giving this error.
    Agr1 is not valid. Please correct the following errors.
    Error -: B2B-52276: Type of the parameter MessageECSFileBlob must match with the value {1}
    On my part I tried to investigate what this MessageECSFileBlob is?
    And the answer I got is that it is part of Document Definition and is  "Absolute file path of ecs".
    My Take & Confusion Around this::
    1. Since I first tried to cater this problem through Healthcare UI so, I have imported the repository for both the versions HL7v2.3 & HLv2.5.1. Now since the B2B shows all the HL7 versions, therefore I didn't create any custom message structure for this since the entire HL7 version repository is already available to me.
    Do I need to remove these versions from the repository and come back to B2B to first provide it custom message structure for both HL7v2.3 & HLv2.5.1?
    2. Any idea if one endpoint can support multiple message structure with different composites in Healthcare UI?
    Thanks
    Saurabh

    Hi citbcj,
    You could "fix" by catching and handling the exception. Here's the pseudo code
    declare
      exception   smtp_error;
      pragma exception_init (smtp_error, -29279);
    begin
      for rec_notify in cur_notify loop
        declare
          l_to   varchar2 (100) := rec_notify.email;
        begin
          html_email (l_to, l_from, l_subject, 'none', l_body);
        exception
          when smtp_error then
            log_it_or_something_and_continue;
        end;
      end loop;
    end;
    /Regards
    Peter

  • Oracle PL/SQL send/receive message in weblogic jms queue

    I am looking for a very simple way using oracle plsql to send and receive messages in a weblogic jms queues.
    Thanks

    Even i am looking for the same . Would be great if someone would help ..The jms setup has to be done in weblogic like the jms server, jms module, Jms connection factory , jms queue and then the jndi names . Now thw Problem here lies to me is that i really dont knw what should be the connection factory targets ,jndi names and where do i give the schema details as in the user name ,password , db name . Also if there is any explaination with eg on how to send /receive messages from a db trigger to jms queues .

  • Send/receive IDOCs to SOLMAN system using AS2 protocol!

    Hi All,
    I want to send/receive IDOC file to/from web based SOLMAN system. Currently I'm using FTP server to send/receive IDOC file.
    As of now the current process is to send the IDOCs from ECC to FTP server and from FTP to third party and vice-versa. But due to some constraints, I'm bound to use web based SOLMAN system. Please, can you let me know how to send/receive IDOC files to SOLMAN. Is there standrad FM/method to connect to SOLMAN from ECC as in case of FTP we have FM 'FTP_CONNECT'. Heard that same functionality in case of SOLMAN can be achieved  through AS2 protocol.
    Kindly help.
    Thanks.
    Regards,
    Mukesh

    Hello Patrice
    We have same issue. Is it possible to use IDoc (XML) directly with SAP 5.0 with SOAP (HTTP) without XI?
    Since your que is three years old, I'm sure you must have found some method for this.
    We'll highly appreciate your help.
    Regards: Gaurave

  • Sms send receive and other basic phone functions

    How do send/receive SMS's on iPhone. Is there a "how-to" manual for the BASIC operation functions for day to day telephone use? Don't need pictures, music or computer ********, jst basic mobile phone use at this stage.

    See Here
    iPhone User Guide
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf

  • Since upgrading to IOS 8.1.2, I cannot send/receive emails from either of my Apple or Verizon email accounts.  Does anyone know how to fix this problem or how to go back to IOS 8.1.1?

    Since upgrading to IOS 8.1.2 on my iPad3, I cannot send/receive emails from either of my Apple or Verizon email accounts.  I confirmed that my internet connection is working. Does anyone know how to fix this problem or how to go back to IOS 8.1.1?

    Hi Milrclan,
    Thanks for contributing to the Apple Support Communities. 
    If you're not able to send or receive email from the mail accounts on your iPad after updating iOS, start with these troubleshooting tips:
    Get help with Mail on iPhone, iPad, and iPod touch - Apple Support
    Best Regards,
    Jeremy 

  • How do I receive multiple texts from the same sender, each individually?

    How do I receive multiple texts from the same sender, each individually?

    So I receive automated reminders from my job & I want them to come individually. For example, one text -- time stamped 10:14 pm, then another 11:12 am, coming as separate msgs.

  • My ISP tells me I need to I need to change the port to send/receive e-mails, but I can't remember my Mail password to add an account. How can I proceed without the password?

    My ISP tells me I need to change the port to send/receive mail, as the current port is going to be disabled for security reasons. But I can't remember my Mail password to add an account. How can I add an account when I don't remember my password? It's been several years.

    your email password is with your ISP so they can help. but if it is saved in the email app you can just change the ports in the preferneces without a password.

  • How does B2B in SOA SUite 11g identify sender/receiver of inbound document?

    Hi All,
    I am checking basic B2B features - custom document protocol. I have defined docuement definition, trading partner, agreement, channels as per guide. When I copy (manually) a sample xml payload (complaint to definition xsd and identification expression), it gives error as the sender could not be identified (receiver is taken as the host as I am putting the file over host's listening channel).
    So question is - how does B2B identify sender, receiver and match the incoming message payload to identify the agreement?
    Thanks in advance.
    regards, sibendu

    Hi Sibendu,
    First of all, let me direct you to the right forum, Oracle Integration B2B forum - Integration - B2B
    Now coming to your question,
    how does B2B identify sender, receiver and match the incoming message payload to identify the agreement?For each and every document, exchange and transport protocol there are certain fields (generally message headers) on the basis of which B2B identifies the sender and receiver. As far as identifying the incoming message payload is concerned, in each and every document definition we define some UNIQUE selection criteria to identify a document. For XML documents, it is the X-Path of some node(and/or it's value) and for non-xml documents, it is the start and end position of some element (and/or it's value) in the document.
    You may get faster and better answer in Oracle B2B forum, for the questions related to Oracle B2B (10g/11g).
    Regards,
    Anuj

  • HT3529 I am currently deployed and was using my iMessage to be able to talk to family back in the states and my iMessage stopped working. It will no longer select my number to use as the send/receive. How do I fix this so I can continue to talk to family?

    I am currently deployed and was using my iMessage to be able to talk to family back in the states and my iMessage stopped working. It will no longer select my number to use as the send/receive. How do I fix this so I can continue to talk to family?

    Read here:
    http://support.apple.com/kb/TS2755

Maybe you are looking for