def test_analyze(filepath):
    metadata = ReplayGainAnalyzer.analyze(filepath, dict())

    # We give rgain3 some leeway here by specifying a tolerance
    tolerance = 0.60
    expected_replaygain = 5.2
    assert abs(metadata["replay_gain"] - expected_replaygain) < tolerance
예제 #2
0
def test_invalid_wma():
    metadata = ReplayGainAnalyzer.analyze(
        u'tests/test_data/44100Hz-16bit-stereo-invalid.wma', dict())
예제 #3
0
def test_ogg_stereo():
    metadata = ReplayGainAnalyzer.analyze(
        u'tests/test_data/44100Hz-16bit-stereo.ogg', dict())
    check_default_metadata(metadata)
예제 #4
0
def test_mp3_mono():
    metadata = ReplayGainAnalyzer.analyze(
        u'tests/test_data/44100Hz-16bit-mono.mp3', dict())
    check_default_metadata(metadata)
예제 #5
0
def test_mp3_utf8():
    metadata = ReplayGainAnalyzer.analyze(
        u'tests/test_data/44100Hz-16bit-stereo-utf8.mp3', dict())
    check_default_metadata(metadata)
예제 #6
0
def test_invalid_filepath():
    metadata = ReplayGainAnalyzer.analyze(u'non-existent-file', dict())
예제 #7
0
def test_missing_replaygain():
    old_rg = ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE
    ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE = 'foosdaf'
    metadata = ReplayGainAnalyzer.analyze(
        u'tests/test_data/44100Hz-16bit-stereo-utf8.mp3', dict())
    ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE = old_rg  # Need to put this back
예제 #8
0
def test_mp3_missing_id3_header():
    metadata = ReplayGainAnalyzer.analyze(
        u'tests/test_data/44100Hz-16bit-mp3-missingid3header.mp3', dict())
def test_analyze_missing_replaygain():
    old = ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE
    ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE = "foobar"
    ReplayGainAnalyzer.analyze("tests/test_data/44100Hz-16bit-mono.mp3",
                               dict())
    ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE = old