DiegoLigtenberg commited on
Commit
af9b34b
1 Parent(s): f14d11b
Files changed (1) hide show
  1. models.py +6 -6
models.py CHANGED
@@ -93,12 +93,12 @@ class SoundToText():
93
  if self.source_type == "YouTube":
94
  self.audio_path = YouTube(self.source).streams.get_by_itag(140).download("output/", filename="audio")
95
 
96
- if self.source_type == "File":
97
- audio = None
98
- if self.source.name.endswith('.wav'): audio = AudioSegment.from_wav(self.source)
99
- elif self.source.name.endswith('.mp3'): audio = AudioSegment.from_mp3(self.source)
100
- audio.export('output/audio.wav', format='wav')
101
- self.audio_path = "output/audio.wav"
102
 
103
  model = whisper.load_model("base")
104
  self.raw_output = model.transcribe(self.audio_path,verbose=True)
 
93
  if self.source_type == "YouTube":
94
  self.audio_path = YouTube(self.source).streams.get_by_itag(140).download("output/", filename="audio")
95
 
96
+ # if self.source_type == "File":
97
+ # audio = None
98
+ # if self.source.name.endswith('.wav'): audio = AudioSegment.from_wav(self.source)
99
+ # elif self.source.name.endswith('.mp3'): audio = AudioSegment.from_mp3(self.source)
100
+ # audio.export('output/audio.wav', format='wav')
101
+ # self.audio_path = "output/audio.wav"
102
 
103
  model = whisper.load_model("base")
104
  self.raw_output = model.transcribe(self.audio_path,verbose=True)