Spaces:
Runtime error
Runtime error
Update audio_foundation_models.py
Browse files
audio_foundation_models.py
CHANGED
|
@@ -978,10 +978,8 @@ class Speech_Enh_SC:
|
|
| 978 |
"representing the audio_path. ")
|
| 979 |
def inference(self, speech_path, ref_channel=0):
|
| 980 |
speech, sr = soundfile.read(speech_path)
|
| 981 |
-
|
| 982 |
-
|
| 983 |
-
# speech = speech[:, ref_channel]
|
| 984 |
-
# print(speech)
|
| 985 |
enh_speech = self.separate_speech(speech[None, ...], fs=sr)
|
| 986 |
audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
|
| 987 |
soundfile.write(audio_filename, enh_speech[0].squeeze(), samplerate=sr)
|
|
|
|
| 978 |
"representing the audio_path. ")
|
| 979 |
def inference(self, speech_path, ref_channel=0):
|
| 980 |
speech, sr = soundfile.read(speech_path)
|
| 981 |
+
if speech.ndim != 1:
|
| 982 |
+
speech = speech[:, ref_channel]
|
|
|
|
|
|
|
| 983 |
enh_speech = self.separate_speech(speech[None, ...], fs=sr)
|
| 984 |
audio_filename = os.path.join('audio', str(uuid.uuid4())[0:8] + ".wav")
|
| 985 |
soundfile.write(audio_filename, enh_speech[0].squeeze(), samplerate=sr)
|