justinsalamon / scaper

A library for soundscape synthesis and augmentation
BSD 3-Clause "New" or "Revised" License
377 stars 55 forks source link

Fix for Issue #113, trimming with isolated events. #115

Closed pseeth closed 4 years ago

pseeth commented 4 years ago

This PR address #113. At the moment, I have updated the test case that looks at trimming to take into account when isolated sources are being saved. The test compares the trimmed audio of the original soundscape with the audio generated from the trimmed JAMS file.

Then, the audio for each event generated from the trimmed JAMS file is summed to make sure it equals the trimmed soundscape.

One thing to note: I don't compare the audio generated from the trimmed JAMS file with the original event audio directly, as in the test loop each individual event audio is not fed into scaper.trim. Only the soundscape is trimmed. I think making sure it sums is enough to show that applying trim then generate_from_jams works.

This PR only has the test case so far, I'll update the code in core.py in the next commit.

justinsalamon commented 4 years ago

@pseeth would it not be most complete to create a trimmed soundscape with saving of all isolated events, then re-generated the soundscape and isolated events from the jams file, and then:

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 5c295af098532e22a7590255df6b555564443364 on fix-for-113 into 33def127bf17cdec3858b868538ee4ea41bd0dde on master.