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

Error in Windows #6

Open
djfkc opened this issue Nov 13, 2022 · 2 comments
Open

Error in Windows #6

djfkc opened this issue Nov 13, 2022 · 2 comments

Comments

@djfkc
Copy link

djfkc commented Nov 13, 2022

New to Python but have hacked many languages.
Tried code as copied from GitHub and received error:

detecting silences
Traceback (most recent call last):
File "C:\ProgramData\scripts\silence_cutter.py", line 165, in
main()
File "C:\ProgramData\scripts\silence_cutter.py", line 161, in main
cut_silences (infile, outfile, dB)
File "C:\ProgramData\scripts\silence_cutter.py", line 101, in cut_silences
silences = findSilences (infile,dB)
File "C:\ProgramData\scripts\silence_cutter.py", line 27, in findSilences
time_list.append (float(words[i+1]))
ValueError: could not convert string to float: '0\r'

Tried fix by simonflick Aug 3 fix:
lines = re.split(r"(\r)?\n", s)

Gave error:
detecting silences
Traceback (most recent call last):
File "C:\ProgramData\scripts\silence_cutter.py", line 172, in
main()
File "C:\ProgramData\scripts\silence_cutter.py", line 169, in main
cut_silences (infile, outfile, dB)
File "C:\ProgramData\scripts\silence_cutter.py", line 103, in cut_silences
silences = findSilences (infile,dB)
File "C:\ProgramData\scripts\silence_cutter.py", line 22, in findSilences
lines = re.split(r"(\r)?\n", s)
NameError: name 're' is not defined

Changed re. to s. to match variable and received error:
detecting silences
Traceback (most recent call last):
File "C:\ProgramData\scripts\silence_cutter.py", line 174, in
main()
File "C:\ProgramData\scripts\silence_cutter.py", line 171, in main
cut_silences (infile, outfile, dB)
File "C:\ProgramData\scripts\silence_cutter.py", line 105, in cut_silences
silences = findSilences (infile,dB)
File "C:\ProgramData\scripts\silence_cutter.py", line 24, in findSilences
lines = s.split(r"(\r)?\n", s)
TypeError: 'str' object cannot be interpreted as an integer

Suggestions and guidance requested.

@sbayrakli
Copy link

silence_cutter.zip
you can find fixed script in attachment.
by the way, do not leave optional parameters blank when you start the script

@DarkTrick
Copy link
Owner

Can you please check if the script in branch fix/windows_cutting will fix your problem?

You can get the file via git clone -b fix/windows_cutting https://github.com/DarkTrick/python-video-silence-cutter.git

This was referenced May 14, 2023
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

3 participants