mirror of
https://github.com/fergalmoran/dss.git
synced 2025-12-25 11:07:35 +00:00
10 lines
288 B
Python
Executable File
10 lines
288 B
Python
Executable File
from mutagen.mp3 import MP3
|
|
from core.utils.audio import Mp3FileNotFoundException
|
|
|
|
|
|
def mp3_length(source_file):
|
|
try:
|
|
audio = MP3(source_file)
|
|
return audio.info.length
|
|
except IOError:
|
|
raise Mp3FileNotFoundException("Audio file not found: %s" % source_file) |