mirror of
https://github.com/gryf/flac2ogg.git
synced 2026-08-20 18:11:53 +02:00
Added support for musepack decoding
This commit is contained in:
+16
-1
@@ -14,7 +14,7 @@ from mutagen.mp3 import MP3
|
|||||||
from mutagen.easyid3 import EasyID3, EasyID3KeyError
|
from mutagen.easyid3 import EasyID3, EasyID3KeyError
|
||||||
|
|
||||||
|
|
||||||
VERSION = '1.0'
|
VERSION = '1.1'
|
||||||
|
|
||||||
|
|
||||||
def match_file(path):
|
def match_file(path):
|
||||||
@@ -315,6 +315,20 @@ class Mp3Type(FileType):
|
|||||||
sp.check_call(["lame", "--decode", self.filename, self.wav])
|
sp.check_call(["lame", "--decode", self.filename, self.wav])
|
||||||
|
|
||||||
|
|
||||||
|
class MusepackType(FileType):
|
||||||
|
"""Musepack filetype"""
|
||||||
|
|
||||||
|
def __init__(self, filename, encoder):
|
||||||
|
super().__init__(filename, encoder)
|
||||||
|
|
||||||
|
def extract_wav(self):
|
||||||
|
"""Extract m4a file to wav"""
|
||||||
|
wav = self.wav
|
||||||
|
if "," in wav:
|
||||||
|
wav = wav.replace(",", "\\,")
|
||||||
|
sp.check_call(["mpcdec", self.filename, self.wav])
|
||||||
|
|
||||||
|
|
||||||
class OggType(FileType):
|
class OggType(FileType):
|
||||||
"""Ogg Vorbis filetype"""
|
"""Ogg Vorbis filetype"""
|
||||||
|
|
||||||
@@ -329,6 +343,7 @@ class Converter(object):
|
|||||||
'.flac': FlacType,
|
'.flac': FlacType,
|
||||||
'.m4a': M4aType,
|
'.m4a': M4aType,
|
||||||
'.mp3': Mp3Type,
|
'.mp3': Mp3Type,
|
||||||
|
'.mpc': MusepackType,
|
||||||
'.ogg': OggType,
|
'.ogg': OggType,
|
||||||
'.wav': WavType,
|
'.wav': WavType,
|
||||||
'.wv': WvType}
|
'.wv': WvType}
|
||||||
|
|||||||
Reference in New Issue
Block a user