Skip to content

Commit

Permalink
Merge pull request #14 from richardassar/dataset_stride_fix
Browse files Browse the repository at this point in the history
Fix incorrect stride when splitting up audio
  • Loading branch information
Kundan Kumar committed May 18, 2018
2 parents 9a19d98 + c6d31b6 commit 2a3dbdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datasets/music/preprocess.py
Expand Up @@ -20,8 +20,8 @@
length = float(subprocess.check_output('ffprobe -i {}/preprocess_all_audio.wav -show_entries format=duration -v quiet -of csv="p=0"'.format(OUTPUT_DIR), shell=True))

# # Step 3: split the big file into 8-second chunks
for i in xrange(int(length)//8 - 1):
os.system('ffmpeg -ss {} -t 8 -i {}/preprocess_all_audio.wav -ac 1 -ab 16k -ar 16000 {}/p{}.flac'.format(i, OUTPUT_DIR, OUTPUT_DIR, i))
for i in xrange(int(length)//8):
os.system('ffmpeg -ss {} -t 8 -i {}/preprocess_all_audio.wav -ac 1 -ab 16k -ar 16000 {}/p{}.flac'.format(i * 8, OUTPUT_DIR, OUTPUT_DIR, i))

# # Step 4: clean up temp files
os.system('rm {}/preprocess_all_audio.wav'.format(OUTPUT_DIR))
Expand Down

0 comments on commit 2a3dbdf

Please sign in to comment.