0

I am trying to send the sound (.wav) file form node server to the java client. Since, I am new on both, I cant be able to figure out how to achieve this? I have written following nodejs program.

var fileStream = files.createReadStream ("/tmp/tts_out.wav");
fileStream.on('open', function(){
fileStream.pipe(socket);

I am unable to write the program. Is there anyone can help?

1 Answer 1

1

Set the content type when you send or stream a file as a response , so that the client to act accordingly . For example browsers need needs to know the file content to play the file .

There is already a similar question please refer HERE

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.