Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -37,8 +37,8 @@ def process_audio_and_display_info(audio_file, interval):
|
|
37 |
seconds, milliseconds = divmod(seconds, 1)
|
38 |
milliseconds *= 1000 # convert from seconds to milliseconds
|
39 |
|
40 |
-
# Convert bitrate to
|
41 |
-
bitrate = audio_info.samplerate * audio_info.channels * bit_depth /
|
42 |
|
43 |
# Calculate speed in kbps
|
44 |
speed_in_kbps = audio_info.samplerate * bit_depth / 1000
|
@@ -49,7 +49,7 @@ def process_audio_and_display_info(audio_file, interval):
|
|
49 |
| :---: | :---: |
|
50 |
| File Name | {os.path.basename(audio_file)} |
|
51 |
| Duration | {int(minutes)} minutes - {int(seconds)} seconds - {int(milliseconds)} milliseconds |
|
52 |
-
| Bitrate | {
|
53 |
| Audio Channels | {audio_info.channels} |
|
54 |
| Samples per second | {audio_info.samplerate} Hz |
|
55 |
| Bit per second | {audio_info.samplerate * audio_info.channels * bit_depth} bit/s |
|
@@ -61,5 +61,6 @@ def process_audio_and_display_info(audio_file, interval):
|
|
61 |
# Return the information table and the download link
|
62 |
return info_table, download_link
|
63 |
|
|
|
64 |
if __name__ == "__main__":
|
65 |
main()
|
|
|
37 |
seconds, milliseconds = divmod(seconds, 1)
|
38 |
milliseconds *= 1000 # convert from seconds to milliseconds
|
39 |
|
40 |
+
# Convert bitrate to kbp/s
|
41 |
+
bitrate = audio_info.samplerate * audio_info.channels * bit_depth / 1000
|
42 |
|
43 |
# Calculate speed in kbps
|
44 |
speed_in_kbps = audio_info.samplerate * bit_depth / 1000
|
|
|
49 |
| :---: | :---: |
|
50 |
| File Name | {os.path.basename(audio_file)} |
|
51 |
| Duration | {int(minutes)} minutes - {int(seconds)} seconds - {int(milliseconds)} milliseconds |
|
52 |
+
| Bitrate | {bitrate} kbp/s |
|
53 |
| Audio Channels | {audio_info.channels} |
|
54 |
| Samples per second | {audio_info.samplerate} Hz |
|
55 |
| Bit per second | {audio_info.samplerate * audio_info.channels * bit_depth} bit/s |
|
|
|
61 |
# Return the information table and the download link
|
62 |
return info_table, download_link
|
63 |
|
64 |
+
|
65 |
if __name__ == "__main__":
|
66 |
main()
|