i'm sending a .wav file from server
app.use('/audio', upload.single('file'), async (req, res) => {
let file = req.file;
const destinationPath = await saveFile(req, res, file);
const text = await stt(destinationPath);
const reply = await talkToGPT(text);
const replyAudioPath = await tts(reply);
res.sendFile(replyAudioPath);
})
and i want to play this audio immediately on react client side, i don't know how to do this react please help me out
axios.post("http://localhost:8080/audio",
data,
config
)
.then((response) => {
})
.catch((error) => {
console.log(error);
});