aspose file tools*
The moose likes Applets and the fly likes Configuring Servers or have to use existing or have to make a new? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Configuring Servers or have to use existing or have to make a new?" Watch "Configuring Servers or have to use existing or have to make a new?" New topic
Author

Configuring Servers or have to use existing or have to make a new?

Ackshat Sharma
Greenhorn

Joined: Sep 03, 2011
Posts: 22
I am working with a audio-streaming web-app and i want my applet to transmit data to the server where i can grab the data and save it at server site.
a) Can Weblogic be configured to recieve data from the applet? if so how can it be done?
b) Is there any open source media server like Adobe media server (which is for flash a/v data) which can be used with the applet(as client). ?
c) I coded a server to recieve the AudioInputStream as:...




I get a file recorded as hello.au but the problem is : on playing the file using any player like VLC the sound is not what was sent from client instead its something not understandable.. beeps and blurred sound.

THANKS ALOT FOR READING THIS AND YOUR REPLIES .
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

You seem to be having a problem in getting data to the server. Check out apache commons file upload http://commons.apache.org/fileupload/


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ackshat Sharma
Greenhorn

Joined: Sep 03, 2011
Posts: 22
@ Maneesh sir, its not a file upload problem as it can also be done using api like cos.jar and making a servlet to handle the file that is posted from a form by POST method, I am capturing a audio using applet and transmitting the captured audio to the server (in the code mentioned), the server is recieving the data and writing it to the disk but the on playing the audio file the sound is not what was sent.

here is the code i am using to write the AudioInputStream to the socket


Ackshat Sharma
Greenhorn

Joined: Sep 03, 2011
Posts: 22
thanks a lot everyone for your concern, I have solved this problem.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Since some tried to help you, it would be nice to know how you solved it in case others in the future have the same problem.

WP
Ackshat Sharma
Greenhorn

Joined: Sep 03, 2011
Posts: 22
how i solved it:
a) the InputStream cannot be typecasted to AudioInoutStream hence have to first store the data chunks in BufferedInputStream
b) then using a AudioInputStream constructor AudioInputStream (InputStream in, AudioFormat format, long length), where the bufferedInputStream in passed in the argument as inputStream and the format is obtained by using getAudioFormat() method and similarily the method getFrameLength gives out the length thus passing all arguments in the constructor gives the correct audioInputStream .

The problem i found is i was trying to use the constructor of AudioInputStream without knowing the metadata of the recieved datachunks so first the metadata must be known and then only the constructor is used.

and this is done using BufferedInputStream storage which first store data chunks in buffer then gives out the metadata and this metadata is used to create the object stream.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuring Servers or have to use existing or have to make a new?