Skip to content

CLN/ENH: Decouple Segments from Sound #154

Closed

Description

@NickleDave

I think we want to decouple Segments from Sound so that a Segments instance does not have an attribute that is a Sound instance.

Instead we should just associate a sample rate with segments and remove need for Sound

This will also mean that we remove the Segment class. We just use a Segments instance with Sound.segment, to get back a new list of Sounds.

Activity

  1. added a commit that references this issue on May 24, 2024
    8e01656
  2. NickleDave commented on Jun 2, 2024

    @NickleDave
    ContributorAuthor

    Some nuance to this:
    I think I have found corner cases that reveal another bug in the original ava segmentation algorithm.
    I only found this because of the pre-condition for Segments where we require that the offset of the last segment not be greater than the length of the Sound in samples.

    So we probably want to keep that condition, to rule out that class of errors that could occur if we're not checking.

    • To do so without requiring that the Sound be around, we can solve the same way we're keeping the start_times / stop_times, etc.: add an attribute n_samples that we get from the sound, just like we get samplerate so we can convert from sample number to time. Then we will save n_samples in the json file representing the segments, just like we will save the samplerate. I need to think more about the name of the attribute but I think this solution generally will work.
  3. added a commit that references this issue on Oct 4, 2024
    fc1d76d
  4. closed this as completedby moving to Done in vocalpy-0.10.0on Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions