#NEWLINE# def test_tempogram_audio( ) : #NEWLINE# #INDENT# def __test( y , sr , oenv , hop_length ) : #NEWLINE# #INDENT# t1 = librosa . feature . tempogram ( y = y , sr = sr , onset_envelope = None , hop_length = hop_length ) #NEWLINE# t2 = librosa . feature . tempogram ( y = None , sr = sr , onset_envelope = oenv , hop_length = hop_length ) #NEWLINE# t3 = librosa . feature . tempogram ( y = y , sr = sr , onset_envelope = oenv , hop_length = hop_length ) #NEWLINE# t4 = librosa . feature . tempogram ( y = ( 0 * y ) , sr = sr , onset_envelope = oenv , hop_length = hop_length ) #NEWLINE# assert np . allclose ( t1 , t2 ) #NEWLINE# assert np . allclose ( t1 , t3 ) #NEWLINE# assert np . allclose ( t1 , t4 ) #NEWLINE# #UNINDENT# ( y , sr ) = librosa . load ( __EXAMPLE_FILE ) #NEWLINE# for hop_length in [ 512 , 1024 ] : #NEWLINE# #INDENT# oenv = librosa . onset . onset_strength ( y = y , sr = sr , hop_length = hop_length ) #NEWLINE# ( yield ( __test , y , sr , oenv , hop_length ) )