Solved

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

Posted on 2000-02-19
7
349 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 200 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
V.simple question about Android packages and libraries 1 38
ejb wildfly example 2 74
Problem to Alipay 10 72
Is Applet the way to go for my drag and drop system? 8 35
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

726 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