Completely removed supported formats check because Pydub is compatible with almost every format.
This commit is contained in:
parent
b77df6987c
commit
ed92c46f95
1 changed files with 2 additions and 13 deletions
|
@ -1,20 +1,10 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from pydub import AudioSegment
|
||||
from pydub.effects import normalize
|
||||
from pygame.mixer import Sound
|
||||
from tinytag import TinyTag
|
||||
|
||||
|
||||
SUPPORTED_FORMATS = [
|
||||
"mp3",
|
||||
"wav",
|
||||
"ogg",
|
||||
"flac",
|
||||
"m4a"
|
||||
]
|
||||
|
||||
|
||||
class Track:
|
||||
"""
|
||||
Class containing data for a track like file path, raw data...
|
||||
|
@ -86,10 +76,9 @@ class Track:
|
|||
self.duration = 0
|
||||
|
||||
def load_audio(self):
|
||||
file_type = self.path.split(".")[-1]
|
||||
#file_type = self.path.split(".")[-1]
|
||||
|
||||
if file_type in SUPPORTED_FORMATS:
|
||||
self.audio = AudioSegment.from_file(self.path)
|
||||
self.audio = AudioSegment.from_file(self.path)
|
||||
|
||||
def remaining(self, position: int):
|
||||
remaining_audio = self.audio[position:]
|
||||
|
|
Loading…
Add table
Reference in a new issue