RexChan commited on
Commit
6f59d89
·
verified ·
1 Parent(s): a35133a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -15,7 +15,7 @@ st.header("Cantonese Song Sentiment Analyzer")
15
 
16
  # load song
17
  input_file = ""
18
- output_file = ".\test1\"
19
 
20
  # preprocess and crop audio file
21
  def audio_preprocess():
@@ -27,15 +27,15 @@ def audio_preprocess():
27
  start_time = 60000 # e.g. 30 seconds, 30000
28
  end_time = 110000 # e.g. 40 seconds, 40000
29
 
30
- audio = AudioSegment.from_file('.\test1\vocals.wav')
31
  cropped_audio = audio[start_time:end_time]
32
- cropped_audio.export('.\cropped_vocals.wav', format='wav') # save vocal audio file
33
 
34
 
35
  # ASR transcription
36
  def asr_model():
37
  # load audio file
38
- y, sr = librosa.load('.\cropped_vocals.wav', sr=16000)
39
 
40
  # ASR model
41
  MODEL_NAME = "RexChan/ISOM5240-whisper-small-zhhk_1"
 
15
 
16
  # load song
17
  input_file = ""
18
+ output_file = ""
19
 
20
  # preprocess and crop audio file
21
  def audio_preprocess():
 
27
  start_time = 60000 # e.g. 30 seconds, 30000
28
  end_time = 110000 # e.g. 40 seconds, 40000
29
 
30
+ audio = AudioSegment.from_file('vocals.wav')
31
  cropped_audio = audio[start_time:end_time]
32
+ cropped_audio.export('cropped_vocals.wav', format='wav') # save vocal audio file
33
 
34
 
35
  # ASR transcription
36
  def asr_model():
37
  # load audio file
38
+ y, sr = librosa.load('cropped_vocals.wav', sr=16000)
39
 
40
  # ASR model
41
  MODEL_NAME = "RexChan/ISOM5240-whisper-small-zhhk_1"