tsi-org commited on
Commit
7451238
·
verified ·
1 Parent(s): 8af0ad8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -30,9 +30,10 @@ def check_password():
30
 
31
 
32
  def save_temporary_audio_file(uploaded_file):
33
- with tempfile.NamedTemporaryFile(delete=False, suffix=".wav", mode='wb') as tmpfile: # Ensure mode is set to 'wb' for binary write
34
- # Directly write the uploaded file content to the temporary file
35
- tmpfile.write(uploaded_file.read()) # Use .read() to read bytes from the uploaded file
 
36
  return tmpfile.name
37
 
38
 
 
30
 
31
 
32
  def save_temporary_audio_file(uploaded_file):
33
+ with tempfile.NamedTemporaryFile(delete=False, suffix=".wav", mode='wb') as tmpfile: # Ensure mode is 'wb' for binary write
34
+ # Read content from the uploaded file and write it to the temporary file
35
+ file_content = uploaded_file.read() # Use .read() to get the file content
36
+ tmpfile.write(file_content)
37
  return tmpfile.name
38
 
39