def test_merge_audio(self): #This merge should succeed, and do nothing note1 = sound.generate_note(1, 1, 440) note2 = numpy.zeros(len(note1)) sound.merge_audio(note2, note1) assert (note2 == note1).all() #This merge should succeed, and do something note3 = sound.generate_note(1, 1, 100) old_note_3 = deepcopy(note3) sound.merge_audio(note3, note1) assert (note3 != old_note_3).all() #This merge should fail and do nothing note4 = sound.generate_note(0.5, 1, 220) old_note_4 = deepcopy(note4) sound.merge_audio(note4, note1) assert (note4 == old_note_4).all()
def test_generate_note(self): note = sound.generate_note(2, 1, 440, 44100) assert len(note) == 44100 * 2