Spaces:
Build error
Build error
parse to float first
Browse files
app.py
CHANGED
@@ -45,8 +45,8 @@ def transcribe(audio_file):
|
|
45 |
|
46 |
|
47 |
def get_duration_ms(audio_file):
|
48 |
-
duration = mediainfo(audio_file)["duration"]
|
49 |
-
duration_ms = int(duration) * 1000
|
50 |
return duration_ms
|
51 |
|
52 |
|
|
|
45 |
|
46 |
|
47 |
def get_duration_ms(audio_file):
|
48 |
+
duration = mediainfo(audio_file)["duration"] # a string in seconds
|
49 |
+
duration_ms = int(float(duration) * 1000)
|
50 |
return duration_ms
|
51 |
|
52 |
|