Skip to content

Commit

Permalink
Update clean_removesilence.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-schwoebel authored Aug 5, 2020
1 parent 95fff71 commit e4e0b4f
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion cleaning/audio_cleaning/clean_removesilence.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
'''
AAA lllllll lllllll iiii
A:::A l:::::l l:::::l i::::i
A:::::A l:::::l l:::::l iiii
A:::::::A l:::::l l:::::l
A:::::::::A l::::l l::::l iiiiiii eeeeeeeeeeee
A:::::A:::::A l::::l l::::l i:::::i ee::::::::::::ee
A:::::A A:::::A l::::l l::::l i::::i e::::::eeeee:::::ee
A:::::A A:::::A l::::l l::::l i::::i e::::::e e:::::e
A:::::A A:::::A l::::l l::::l i::::i e:::::::eeeee::::::e
A:::::AAAAAAAAA:::::A l::::l l::::l i::::i e:::::::::::::::::e
A:::::::::::::::::::::A l::::l l::::l i::::i e::::::eeeeeeeeeee
A:::::AAAAAAAAAAAAA:::::A l::::l l::::l i::::i e:::::::e
A:::::A A:::::A l::::::ll::::::li::::::ie::::::::e
A:::::A A:::::A l::::::ll::::::li::::::i e::::::::eeeeeeee
A:::::A A:::::A l::::::ll::::::li::::::i ee:::::::::::::e
AAAAAAA AAAAAAAlllllllllllllllliiiiiiii eeeeeeeeeeeeee
/ __ \ | (_) / _ \ | ___ \_ _| _
| / \/ | ___ __ _ _ __ _ _ __ __ _ / /_\ \| |_/ / | | (_)
| | | |/ _ \/ _` | '_ \| | '_ \ / _` | | _ || __/ | |
| \__/\ | __/ (_| | | | | | | | | (_| | | | | || | _| |_ _
\____/_|\___|\__,_|_| |_|_|_| |_|\__, | \_| |_/\_| \___/ (_)
__/ |
|___/
___ _ _
/ _ \ | (_)
/ /_\ \_ _ __| |_ ___
| _ | | | |/ _` | |/ _ \
| | | | |_| | (_| | | (_) |
\_| |_/\__,_|\__,_|_|\___/
This cleaning script takes in a folder of audio files and removes the silence
from these audi files using a voice activity detector.
This cleaning script is enabled if default_audio_cleaners=['clean_removesilence']
'''
import collections, contextlib, sys, wave, webrtcvad, os, sys, uuid

def convert_mono(audiofile):
Expand Down Expand Up @@ -165,4 +204,4 @@ def clean_removesilence(audiofile):
# remove temporary files and leave only cleaned files
os.remove(audiofile[0:-4]+'_temp.wav')
for i in range(len(framelist)):
os.remove(framelist[i])
os.remove(framelist[i])

0 comments on commit e4e0b4f

Please sign in to comment.