fix linter issues

pull/510/head
WeberJulian 2021-03-06 23:24:12 +01:00 committed by Eren Gölge
parent a1839d3245
commit 16ce4e4805
2 changed files with 10 additions and 9 deletions

View File

@ -7,9 +7,9 @@ from argparse import RawTextHelpFormatter
from multiprocessing import Pool
from tqdm import tqdm
def resample_file(filename):
global args
y, sr = librosa.load(filename, sr=args.output_sr)
def resample_file(func_args):
filename, output_sr = func_args
y, sr = librosa.load(filename, sr=output_sr)
librosa.output.write_wav(filename, y, sr)
if __name__ == '__main__':
@ -59,6 +59,7 @@ if __name__ == '__main__':
print('Resampling the audio files...')
audio_files = glob.glob(os.path.join(args.input_dir, '**/*.wav'), recursive=True)
print(f'Found {len(audio_files)} files...')
audio_files = list(zip(audio_files, len(audio_files)*[args.output_sr]))
with Pool(processes=args.n_jobs) as p:
with tqdm(total=len(audio_files)) as pbar:
for i, _ in enumerate(p.imap_unordered(resample_file, audio_files)):

View File

@ -59,9 +59,9 @@ abbreviations_fr = [(re.compile('\\b%s\\.' % x[0], re.IGNORECASE), x[1])
('excl', 'exclusivement'),
('boul', 'boulevard'),
]] + [(re.compile('\\b%s' % x[0]), x[1])
for x in [
('Mlle', 'mademoiselle'),
('Mlles', 'mesdemoiselles'),
('Mme', 'Madame'),
('Mmes', 'Mesdames'),
]]
for x in [
('Mlle', 'mademoiselle'),
('Mlles', 'mesdemoiselles'),
('Mme', 'Madame'),
('Mmes', 'Mesdames'),
]]