'Constructs a new `MediaFile` reflecting the file at path. May
throw `UnreadableFileError`.
By default, MP3 files are saved with ID3v2.4 tags. You can use
the older ID3v2.3 standard by specifying the `id3v23` option.'

def __init__(self, path, id3v23=False):

    self.path = path
    self.mgfile = mutagen_call('open', path, mutagen.File, path)
    if (self.mgfile is None):
        raise FileTypeError(path)
    elif ((type(self.mgfile).__name__ == 'M4A') or (type(self.mgfile).__name__ == 'MP4')):
        info = self.mgfile.info
        if (info.codec and info.codec.startswith('alac')):
            self.type = 'alac'
        else:
            self.type = 'aac'
    elif ((type(self.mgfile).__name__ == 'ID3') or (type(self.mgfile).__name__ == 'MP3')):
        self.type = 'mp3'
    elif (type(self.mgfile).__name__ == 'FLAC'):
        self.type = 'flac'
    elif (type(self.mgfile).__name__ == 'OggOpus'):
        self.type = 'opus'
    elif (type(self.mgfile).__name__ == 'OggVorbis'):
        self.type = 'ogg'
    elif (type(self.mgfile).__name__ == 'MonkeysAudio'):
        self.type = 'ape'
    elif (type(self.mgfile).__name__ == 'WavPack'):
        self.type = 'wv'
    elif (type(self.mgfile).__name__ == 'Musepack'):
        self.type = 'mpc'
    elif (type(self.mgfile).__name__ == 'ASF'):
        self.type = 'asf'
    elif (type(self.mgfile).__name__ == 'AIFF'):
        self.type = 'aiff'
    elif (type(self.mgfile).__name__ == 'DSF'):
        self.type = 'dsf'
    else:
        raise FileTypeError(path, type(self.mgfile).__name__)
    if (self.mgfile.tags is None):
        self.mgfile.add_tags()
    self.id3v23 = (id3v23 and (self.type == 'mp3'))
