Merge pull request #2926 from tilmankamp/fix-mailab-importer
M-AILAB importer: Ensure all samples are 16 kHz
This commit is contained in:
commit
eed66e3b75
@ -60,6 +60,11 @@ def one_sample(sample):
|
|||||||
file_size = -1
|
file_size = -1
|
||||||
frames = 0
|
frames = 0
|
||||||
if os.path.exists(wav_filename):
|
if os.path.exists(wav_filename):
|
||||||
|
tmp_filename = os.path.splitext(wav_filename)[0]+'.tmp.wav'
|
||||||
|
subprocess.check_call(
|
||||||
|
['sox', wav_filename, '-r', str(SAMPLE_RATE), '-c', '1', '-b', '16', tmp_filename], stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
os.rename(tmp_filename, wav_filename)
|
||||||
file_size = os.path.getsize(wav_filename)
|
file_size = os.path.getsize(wav_filename)
|
||||||
frames = int(
|
frames = int(
|
||||||
subprocess.check_output(
|
subprocess.check_output(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user