Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -62,13 +62,14 @@ SIDEBAR_INFO = f"""
|
|
62 |
|
63 |
|
64 |
|
65 |
-
# ============
|
66 |
@spaces.GPU()
|
67 |
-
def convert_to_wav(
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
72 |
# ================================[------------------------]
|
73 |
|
74 |
|
|
|
62 |
|
63 |
|
64 |
|
65 |
+
# ============UPDATED============[convert m4a audio to wav]
|
66 |
@spaces.GPU()
|
67 |
+
def convert_to_wav(filepath):
|
68 |
+
_,file_ending = os.path.splitext(f'{filepath}')
|
69 |
+
audio_file = filepath.replace(file_ending, ".wav")
|
70 |
+
print("starting conversion to wav")
|
71 |
+
os.system(f'ffmpeg -i "{filepath}" -ar 16000 -ac 1 -c:a pcm_s16le "{audio_file}"')
|
72 |
+
return audio_file
|
73 |
# ================================[------------------------]
|
74 |
|
75 |
|