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?

Raghavan
  • 883
  • 1
  • 8
  • 19
rughimire
  • 374
  • 1
  • 5
  • 16

1 Answers1

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

Community
  • 1
  • 1
Raghavan
  • 883
  • 1
  • 8
  • 19