I need to insert in a boostrap modal the possibility to record a microphone audio and pass the file to the django view.
For the text I did it like this but I don't know how to do it for the audio, ideas?
HTML:
<div class="modal fade" id="textModal">
<div class="modal-dialog">
<div class="modal-content">
<form action="results_text_analysis" method="POST">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Input text</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<!-- Modal body -->
<div class="modal-body">
{% csrf_token %}
<textarea type="text" class="form-control input-lg" name="text"></textarea>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Calculate</button>
</div>
</form>
</div>
</div>
VIEW:
@api_view(['POST'])
def results_text_analysis(request):
input_text = request.POST['text']
.....