Hi All,

I am trying to write a servlet that would stream a wave file to the browser.
The following is the code snippet.

        byte[] cont=new byte[1024];
            System.out.println("Entering Servlet");
            response.setContentType("audio/x-wave");
            response.setHeader("Content-Disposition","name=notify.wav");
            response.setBufferSize(1024);

            FileInputStream fs= new FileInputStream("c:\\notify.wav");
            System.out.println("Opened the File");
            ServletOutputStream out = response.getOutputStream();

            while(fs.read(cont)!=-1)
            {
                System.out.println("Writing Chunk");
                out.write(cont);
            }
            fs.close();
            System.out.println("Closing File");
            out.flush();
            out.close();


I am employing Apache Tomcat 4.0 (Catalina) for servlet engine. Everything
from the server's end seems normal, No exceptions thrown. But Media Browsers
like Real Audio, Winamp fails to play the wave. Can anyone please help.

Thanks in advance guyz.

regards,
Muthu

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to