Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pad cutoff time by 0.025s #4

Open
Incognito opened this issue Jul 17, 2022 · 4 comments · May be fixed by #12
Open

Pad cutoff time by 0.025s #4

Incognito opened this issue Jul 17, 2022 · 4 comments · May be fixed by #12

Comments

@Incognito
Copy link

Incognito commented Jul 17, 2022

Great script, thanks for publishing this. I had a small issue where the cutoff times were a bit too accurate leading to the audio sounding like it was a "skipping cd track", so I just made a small tweak:

  for line in lines:
    if ("silencedetect" in line):
        words = line.split(" ")
        for i in range (len(words)):
            if ("silence_start" in words[i]):
              time_list.append (float(words[i+1]) + 0.025)  # changed here
            if "silence_end" in words[i]:
              time_list.append (float (words[i+1]) - 0.025)   # changed here
  silence_section_list = list (zip(*[iter(time_list)]*2))

It lead to an overall smoother listening experience. I think it could become a proper feature with an argument if you find this kind of feature interesting.

In my code I do not handle an edge case where the silence cut is less than 0.05s.

I'm using this to cut silence out while reading from a teleprompter (taking a break to breathe, drink water, etc).

@DarkTrick
Copy link
Owner

Thank you very much for looking into this!

What I understand
If I understand your intention correctly, you needed a minimum amount of length to not be cut away between two different points - in your specific case: 0.05s.

Good idea, unusable code
I really like the idea, but I can't use the code you posted because - as you already figured I do not handle an edge case where the silence cut is less than 0.05s..

Could you generalize the code?

  1. Could you generalize the code, so
    1.1 your 0.05s become a parameter
    1.2 the edge case is covered
  2. Can you provide a sample file for testing? (can be a simple artificial noise file created in audacity)

Background: I would love to do it myself, but I won't find the time in the near future. I could, however, review a pull request with a test file.

@Incognito
Copy link
Author

Incognito commented Jul 17, 2022

If I understand your intention correctly, you needed a minimum amount of length to not be cut away between two different points - in your specific case: 0.05s.

Basically the situation is that if speaking begins at 1s the track will cut 0s-1s, but those few milliseconds before the cut are needed to have a pleasant listening experience.

Good idea, unusable code

This is clear, I just wanted to know if you saw this as a useful change or not. Not all projects accept changes or it might be decided as "not something we want".

@Incognito
Copy link
Author

I am playing a bit with some editing techniques, if I use this more frequently I will submit a MR.

@DarkTrick
Copy link
Owner

Not all projects accept changes or it might be decided as "not something we want".
Indeed. Very familiar with that, too.
Your idea is very welcome here!

I am playing a bit with some editing techniques, if I use this more frequently I will submit a MR.
I'm looking forward to receiving a MR! 👍

@eykd eykd linked a pull request Sep 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants