Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Applet to capture audio and save .wav at the web server

Posted on 2000-02-19
7
Medium Priority
?
357 Views
Last Modified: 2012-06-27
Hi,
   I have developed an applet that captures audio from mic
   and saves sound on the client machine. However, I need to
   to store this file at the web server, without creating any
   file at the web server.

   Can anyone help me out ?

regards,
Raghu.
0
Comment
Question by:raghurani
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 1

Author Comment

by:raghurani
ID: 2539337
More details :

I do not wish to go for RTP as it does not guarantee no-loss transmission. More over, I do NOT wish to
play the sound at the web-server, on the fly. I just need to save it as a file.
0
 
LVL 8

Expert Comment

by:diakov
ID: 2539498
"...However, I need to
   to store this file at the web server, without creating any
   file at the web server..."

This is a bit difficult to understand.

The applet actually runs on the client machine, and you need something at the server side to be able to accept the data stream you send to it and save it to a file.
You can ise a servlet, CGI program, separate application that listens on a socket, etc.

Servlet would be the best choice.

Cheers,
  Nik
0
 
LVL 7

Accepted Solution

by:
Ravindra76 earned 800 total points
ID: 2539692
I agree with diakov

Ur comments
>>

"...However, I need to
   to store this file at the web server, without creating any
   file at the web server..."

is not clear.

Storing the file at webserver without creating any file is confusing..

If U want applet to write to webserver
see the below text otherwise ignore my comment..
Write all the code in servlet to write into the file.
Call this servlet from applet by using URLConnection class.

I think You know the syntax of connecting applet to servlet

URLConnection conn = new URL("http://yoursite:yourport/servlet/YourServlet"').openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.connect();

Nothing to do in your applet because all will handle by servlet


Your servlet basically contains the following code

// Write code to inport necessary.

public class YourServlet extends HttpServlet {

   // Write code for init method if needed
  // write code for service or doget or dopost method depending on your strategy

public void service(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException {

  String filename = "a.txt";
  /* If you want filename from applet,append it like this in your appletcode

   URL url = new URL("http://yoursite:yourport/servlet/yourservlet?filename=a.txt");
    URLConnection =  url.openConnection(); */
// in this case

 // String filename = req.getParameter("filename");
   
// Write normal code to open file and print it.Put it in try,catch block

 FileWriter fw = new FileWriter(filename);
 fw.pritln("HelloWorld")
   



 
Comment  
From: mbormann
 Date: Friday, October 22 1999 - 11:00PM CST    
(1)
http://www.j-nine.com/pubs/applet2servlet/index.htm 
http://www.devx.com/upload/free/features/javapro/1999/05may99/lo0599/lo0599.asp 

(2)
http://www.servletsource.com/code/writefile.html 
http://www.servletsource.com/code/ReadFile.html

 
Best of luck
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 8

Expert Comment

by:diakov
ID: 2539739
Well, a database on the server is also an option, then a direct JDBC connection (depends on the DBMS) or again through a servlet are the possibilities.

Nik
0
 
LVL 1

Author Comment

by:raghurani
ID: 2553349
Well,

  I need to capture the audio and save it in a file
  at the server end. I am able to capture the sound
  & store it in javax.sound.sampled.AudioInputStream.
  However I was not able to pass it no to the servlet
  as it requires the object to be serialized. For this I
  "wrapped" AudioInputStream object in my own
  defined AudioStream object. But, the error continues
  to exist and expects AudioInputStream object also
  to be serialized.

  How can I overcome this ?

  I understand that this question is out of the scope.
  I would be glad if you friends can give me some
  pointers.
  I am sure to close this question as soon as my
  this comment is addressed. Any helpful URLs
  are also welcome.

  Thanks for the support.

regards,
Raghu
0
 
LVL 1

Author Comment

by:raghurani
ID: 2578970
Thanks for the excellent work, ravindra76.
Congrats and sorry for the delay.
0
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2582858
No Problem

:) :) :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question