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.
@ 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
posted 8 years ago
thanks a lot everyone for your concern, I have solved this problem.
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.
posted 8 years ago
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'm not sure if I approve of this interruption. But this tiny ad checks out:
Devious Experiments for a Truly Passive Greenhouse!