Skip to content

Commit

Permalink
Merge pull request #30 from jimmyknowles/jimmyknowles-segments-cap
Browse files Browse the repository at this point in the history
Update segments.py to handle uppercase file extensions
  • Loading branch information
kahst authored May 10, 2022
2 parents d4edfdd + f1d1e0c commit b5359d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def parseFolders(apath, rpath, allowed_filetypes={'audio': ['wav', 'flac', 'mp3'
# Get all audio files
for root, dirs, files in os.walk(apath):
for f in files:
if f.split('.')[-1] in allowed_filetypes['audio']:
if f.split('.')[-1].lower() in allowed_filetypes['audio']:
data[f.rsplit('.', 1)[0]] = {'audio': os.path.join(root, f), 'result': ''}

# Get all result files
Expand Down Expand Up @@ -254,4 +254,4 @@ def extractSegments(item):

# A few examples to test
# python3 segments.py --audio example/ --results example/ --o example/segments/
# python3 segments.py --audio example/ --results example/ --o example/segments/ --seg_length 5.0 --min_conf 0.1 --max_segments 100 --threads 4
# python3 segments.py --audio example/ --results example/ --o example/segments/ --seg_length 5.0 --min_conf 0.1 --max_segments 100 --threads 4

0 comments on commit b5359d4

Please sign in to comment.