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

Reduce padding on subtitle times #48

Closed
NinKenDo64 opened this issue Dec 22, 2019 · 4 comments
Closed

Reduce padding on subtitle times #48

NinKenDo64 opened this issue Dec 22, 2019 · 4 comments

Comments

@NinKenDo64
Copy link

NinKenDo64 commented Dec 22, 2019

Great tool, thank you for your efforts.

I do wish for one feature especially though, it's almost a deal-breaker, and that's the ability to adjust the padding of subtitle times through an argument when generating Anki cards through substudy.

It seems to me, and correct me if I'm wrong, but it certainly seems that the times are being automatically padded by substudy, meaning there is extra time added on both the start and the end.

This might be a sensible default, as it's presumably better to have a little too much of what's said, than too little, but I have some pretty nicely timed subtitles, and it would be great to be able to prevent this padding from taking place, even if it's not the default.

I've tried looking through the source, but tbh, I'm not a great programmer, I'm actually integrating substudy into some scripts, but I've been looking at a lot of python and POSIX sh for the last few years, not so much C-like languages, and I'm totally unfamiliar with Rust. It seems a lot isn't commented, so I find my eyes glazing over and my brain shutting down when I tried to figure stuff out in the source myself.

Even if this isn't what's happening, perhaps a command line argument to reduce or increase padding would be good.

I'd try to implement it myself as I'm sure it's rather simple, but for the reasons I stated earlier, I'm pretty much at the mercy of your (or some other kind soul's) benevolence.

@NinKenDo64
Copy link
Author

I eventually modified the source where I thought the timing might be getting added, but the program won't compile on my machine, so I've given up. A real shame.

@emk
Copy link
Owner

emk commented Mar 30, 2020

I'm sorry that the defaults don't work for you!

I've made and reviewed tons of cards (probably 10,000+ reps), from tons of different subtitle sources. Sometimes those subtitles exactly matched the audio timing, and sometimes they were approximate.

The problems with making the padding any smaller are:

  1. You'll wind up with far more "useless" cards where critical audio gets clipped.
  2. Even if your subtitle timing is exact, which almost never happens, the padding provides a small amount of helpful context.

My apologies if you've tried reviewing cards and the padding still doesn't work for you. I prefer not to have lots of extra command-line options, particularly ones which I think will cause large groups of users to generate bad substudy decks by mistake. My apologies if the defaults don't work for you.

@NinKenDo64
Copy link
Author

No worries. Any chance you could point out to me the lines where padding is added, so that I can patch it for my own use?

@emk
Copy link
Owner

emk commented Apr 5, 2020

Try here:

conv.period = conv.period.grow(2.5, 2.5);

Good luck!

@emk emk closed this as completed Apr 5, 2020
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

No branches or pull requests

2 participants