How to send a wav file to the browser? #1976
-
I'm working on a browser based voice assistant and trying to play a wav audio in the browser emited by the soicketIO as a response from the server. Here I'm receiving the data as multiple buffers but it takes a long time. Also that data is not playable by JS. What's the correct way to send and receive an audio file using socketIO? Server:
Client:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This isn't a question that is related to Socket.IO. What you need to do is extract the raw audio from the wav file, which is what the Audio object in the browser uses. But I suggest you find a dedicated resource to learn all the details, since neither the server nor the client side are as simplistic as you have them in the code above. |
Beta Was this translation helpful? Give feedback.
This isn't a question that is related to Socket.IO. What you need to do is extract the raw audio from the wav file, which is what the Audio object in the browser uses. But I suggest you find a dedicated resource to learn all the details, since neither the server nor the client side are as simplistic as you have them in the code above.