rphrp1985 commited on
Commit
1c16477
1 Parent(s): 86fd2d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -132,15 +132,15 @@ def do_ML(filename:str,text:str):
132
 
133
  def compress_audio_wav_bytes(wav_bytes, output_format):
134
  # Load the WAV data from bytes
135
- audio_data, sample_rate = sf.read((wav_bytes))
136
 
137
  # Compress and save the audio data with the specified output format
138
- output_bytes = io.BytesIO()
139
- sf.write(output_bytes, audio_data, sample_rate, format=output_format)
140
 
141
  # Retrieve the compressed audio data as bytes
142
- compressed_bytes = output_bytes.getvalue()
143
- return compressed_bytes
144
 
145
 
146
 
 
132
 
133
  def compress_audio_wav_bytes(wav_bytes, output_format):
134
  # Load the WAV data from bytes
135
+ audio_data, sample_rate = sf.read((wav_bytes))
136
 
137
  # Compress and save the audio data with the specified output format
138
+ output_bytes = io.BytesIO()
139
+ sf.write(output_bytes, audio_data, sample_rate, format=output_format)
140
 
141
  # Retrieve the compressed audio data as bytes
142
+ compressed_bytes = output_bytes.getvalue()
143
+ return compressed_bytes
144
 
145
 
146