Answer the question
In order to leave comments, you need to log in
Sending a request from Vue to Flask to get an audio recording from the send_from_directory() method. How do I embed audio on Vue with Flask?
Sending a request from Vue to Flask for an audio recording. Audio comes to postman, and string comes to Vue. How do I embed audio on Vue with Flask?
Return audio from the Flask server.
return send_from_directory('./static/wavs/', wav_name,
mimetype='audio/wav',
as_attachment=False)
<div class="d-flex align-items-center">
<audio>
<source :src="response" type="audio/wav">
</audio>
</div>
UklGRiSGAABXQVZFZm10IBAAFFAABAAEAIlYAAESsAAACABAAZGF0YQCGAADFAaQAOv9UAQ0C1f4q
axios('http://' + 'localhost:5000' + '/sinth', {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
data: data
})
.then((response) => {
this.response = response;
this.show_response = true;
this.spinner_visible = false;
return response;
})
.catch((error) => {
console.log(error);
this.spinner_visible = false;
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question