I have a problem when my site sends converted audio in base64 to my server it converts the base64 in audio format and works with it. But when the site is accessed from an iPhone and the recording arrives at the server, then a one-second recording after converting remains on the server. On all other devices and operation systems, everything comes and is processed normally. How can this be fixed? This converter's python code on server:
...
data = json.loads(await request.body())
file = open(f'{UPLOAD_DIRECTORY}/' + ID_file + '.wav', "wb")
file.write(base64.b64decode(data['audio']))
file.close()
...
This converter's JS code on site:
...
var reader = new window.FileReader();
reader.readAsDataURL(audioBlob);
reader.onloadend = function() {
base64 = reader.result;
base64 = base64.split(',')[1];
...