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.
@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:
compare the final soundscape audio (original vs re-generated)
compare each individual isolated event (original vs re-generated)?
Coverage remained the same at 100.0% when pulling 5c295af098532e22a7590255df6b555564443364 on fix-for-113 into 33def127bf17cdec3858b868538ee4ea41bd0dde on master.
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 applyingtrim
thengenerate_from_jams
works.This PR only has the test case so far, I'll update the code in
core.py
in the next commit.