bartman081523 commited on
Commit
400c3a4
1 Parent(s): a5e228d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import soundfile as sf
3
  from scipy import signal
4
  import gradio as gr
5
  import shutil
 
6
 
7
  def generate_vinyl_sound(noise_ratio, lowcut, highcut, duration, pop_rate):
8
  # Parameters
@@ -54,7 +55,7 @@ def convert_to_wav(data, sample_rate):
54
  data /= np.max(np.abs(data))
55
 
56
  # Save to a temporary .wav file
57
- temp_file = "vinyl_sound.wav"
58
  sf.write(temp_file, data, sample_rate)
59
 
60
  return temp_file
 
3
  from scipy import signal
4
  import gradio as gr
5
  import shutil
6
+ import tempfile
7
 
8
  def generate_vinyl_sound(noise_ratio, lowcut, highcut, duration, pop_rate):
9
  # Parameters
 
55
  data /= np.max(np.abs(data))
56
 
57
  # Save to a temporary .wav file
58
+ temp_file = tempfile.mktemp(suffix=".wav")
59
  sf.write(temp_file, data, sample_rate)
60
 
61
  return temp_file