def instantiateSong(fileName):
    """Create an AudioSegment with the data from the given file"""
    ext = detectFormat(fileName)
    if(ext == "mp3"):
        return pd.AudioSegment.from_mp3(fileName)
    elif(ext == "wav"):
        return pd.AudioSegment.from_wav(fileName)
    elif(ext == "ogg"):
        return pd.AudioSegment.from_ogg(fileName)
    elif(ext == "flv"):
        return pd.AudioSegment.from_flv(fileName)
    elif(ext == "m4a"):
        return pd.AudioSegment.from_file(fileName, "mp4")
    else:
        return pd.AudioSegment.from_file(fileName, ext)
def instantiateSong ( fileName ) : ext = detectFormat ( fileName ) if ( ext == "mp3" ) : return pd . AudioSegment . from_mp3 ( fileName ) elif ( ext == "wav" ) : return pd . AudioSegment . from_wav ( fileName ) elif ( ext == "ogg" ) : return pd . AudioSegment . from_ogg ( fileName ) elif ( ext == "flv" ) : return pd . AudioSegment . from_flv ( fileName ) elif ( ext == "m4a" ) : return pd . AudioSegment . from_file ( fileName , "mp4" ) else : return pd . AudioSegment . from_file ( fileName , ext )
Create an AudioSegment with the data from the given file