Skip to content

Commit

Permalink
Refactor of an4 downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanNaren committed Apr 24, 2017
1 parent 63c8b88 commit b939fb2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions data/an4.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import io
import shutil

import subprocess
import tarfile
import wget

from utils import create_manifest

Expand Down Expand Up @@ -65,16 +65,17 @@ def _process_transcript(transcripts, x):
def main():
root_path = 'an4/'
name = 'an4'
subprocess.call(['wget http:https://www.speech.cs.cmu.edu/databases/an4/an4_raw.bigendian.tar.gz'], shell=True)
subprocess.call(['tar -xzvf an4_raw.bigendian.tar.gz'], stdout=open(os.devnull, 'wb'), shell=True)
wget.download('http:https://www.speech.cs.cmu.edu/databases/an4/an4_raw.bigendian.tar.gz')
tar = tarfile.open('an4_raw.bigendian.tar.gz')
tar.extractall()
os.makedirs(args.target_dir)
_format_data(root_path, 'train', name, 'an4_clstk')
_format_data(root_path, 'test', name, 'an4test_clstk')
shutil.rmtree(root_path)
os.remove('an4_raw.bigendian.tar.gz')
train_path = args.target_dir + '/train/'
test_path = args.target_dir + '/test/'
print ('Creating manifests...')
print ('\n', 'Creating manifests...')
create_manifest(train_path, 'an4_train')
create_manifest(test_path, 'an4_val')

Expand Down

0 comments on commit b939fb2

Please sign in to comment.