Open justinsalamon opened 8 years ago
As you said, in some use cases, the users want different durations from the same scaper object.
In the case of speech recognition, an utterance can't be cut. This leaves the user with only choice, making the duration match the longest utterance.
When I looked at the documentation, I found out about the protected_labels
argument. The problem is, it only applies to the event duration. Specifying a protected label will have no effect on the overall duration of a soundscape. As you said
the background duration is set as soon as it's added based on the duration value provided during initialization
I wonder if in this particular use case, the thing to be changed is the logic of protected_labels
. Maybe it should be able to override the duration of the soundscape by checking if the background is shorter than the start of the utterance in the soundscape + its duration. Then it would extend the background duration accordingly.
Not really sure about this solution, and I agree that duration should eventually become a function argument, this would also allow the tuple distribution logic to be applied on this parameter.
Under some scenarios the user might want to create soundscapes with different durations from the same scaper object. Right now this is not supported and the soundscape duration must be set during initialization (furthermore, the background duration is set as soon as it's added based on the duration value provided during initialization).
This enhancement involves changing the soundscape duration from an object variable to a function argument (e.g. to
generate()
) to support changing the soundscape duration on the fly. It would also require changing the duration of all background events on the fly.