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

Link between window parameter and sample rate #41

Open
andiandi13 opened this issue Jan 1, 2021 · 2 comments
Open

Link between window parameter and sample rate #41

andiandi13 opened this issue Jan 1, 2021 · 2 comments

Comments

@andiandi13
Copy link

andiandi13 commented Jan 1, 2021

I don't understand something.

I have two audio tracks. The destination track begins 4950ms after the source track, so I shifted my subs like this in the first place :

sushi --src 001.wav --dst 002.wav --script 001.srt

However, the first seconds before the intro are too late in the subs (the rest of the subs after the intro are perfect).

So after reading the wiki, I understood that increasing the window would help.

I tried :

sushi --src 001.wav --dst 002.wav --window 15 --script 001.srt

But the resulting .ass file is the exact same.

So I just took the line from the wiki, adding sample rate, without knowing what I was doing :

sushi --src 001.wav --dst 002.wav --window 15 --sample-rate 24000 --script 001.srt

And now the shifted subtitle file is perfectly synced in the beginning. So :

1) Why do I have to specify a sample rate, what's it's role ?
2) Does it have to be 24KHz everytime ?
3) Also, about the window, I wanted to know what's the unit ? window 15 = 15ms ? 15seconds ?

@qgustavor
Copy link

  1. When using a .wav input you need to specify a sample rate otherwise it will use a default sample rate of 12000 Hz.
  2. If you use a .wav input it needs to match the sample rate of your input, otherwise it will convert your input to wav using the sample rate specified in --sample-rate defaulting to 12000 Hz.
  3. In at least two parts of the code, here and here, appears that window is measured in seconds.

@andiandi13
Copy link
Author

andiandi13 commented Mar 22, 2021

@qgustavor Thanks a lot for these informations, it's really helpful !

Can you just specify what you mean in the second point ?
If I understood, if I have a 48 KHz WAV as an input, I have to write --sample-rate 48000 or it'll convert it to 12000 right ?

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