# Path: util/data_preprocessing.py
# WAV_FILE_MIN_LEN = 2.00 # in seconds
# WAV_FILE_MAX_LEN = 5.00 # in seconds
# def convert_mp4(video_dir, audio_dir):
# def read_json_file(file_path):
# def find_text_and_time_limits(alignment_data):
# def split(split_file_path, main_file_path, transcript_path, split_info):
# def split_aligned_audio(audio_dir, json_dir	, output_dir_train, output_dir_dev,
# 						output_dir_test, train_split, dev_split, test_split):
# def create_csv(data_dir):


import os
import argparse
import sys
from util import data_preprocessing
parser.add_argument('output_dir_train', type=str,
					help='Output dir for storing training files (with trailing slash)')
parser.add_argument('output_dir_dev', type=str,
					help='Output dir for storing files for validation (with trailing slash)')
parser.add_argument('output_dir_test', type=str,
					help='Output dir for storing test files (with a trailing slash)')
parser.add_argument('train_split', type=float,
					help='a float value for deciding percentage of data split for training the model')
parser.add_argument('dev_split', type=float,
					help='a float value for deciding percentage of validation data')
parser.add_argument('test_split', type=float,
					help='a float value for deciding percentage of test data')

args = parser.parse_args()

# Set default locations
video_dir = "data/RHL_mp4/"
json_dir = "data/RHL_json/" 
audio_dir = "data/RHL_wav/"

# Percentages/ratios should add up to 1.0 
if args.train_split + args.dev_split + args.test_split != 1.0:
	print "Make sure that train, test, and dev split ratios add upto 1.0"
	exit()

# Convert any mp4 found in data/RHL_mp4/ and store it in data/RHL_wav/
data_preprocessing.convert_mp4(video_dir, audio_dir)
print "[INFO]: Main video files converted to .wav files. Now splitting starts."

# Split all big wav files at data/RHL_wav/ and stores them at proper locations.(data/clean_data/ by default)

# Path: util/data_preprocessing.py
# WAV_FILE_MIN_LEN = 2.00 # in seconds
# WAV_FILE_MAX_LEN = 5.00 # in seconds
# def convert_mp4(video_dir, audio_dir):
# def read_json_file(file_path):
# def find_text_and_time_limits(alignment_data):
# def split(split_file_path, main_file_path, transcript_path, split_info):
# def split_aligned_audio(audio_dir, json_dir	, output_dir_train, output_dir_dev,
# 						output_dir_test, train_split, dev_split, test_split):
# def create_csv(data_dir):


# Path: bin/preprocess_data_audio.py
import os
import argparse
import sys
from util import data_preprocessing

parser.add_argument('output_dir_train', type=str,
					help='Output dir for storing training files (with trailing slash)')
parser.add_argument('output_dir_dev', type=str,
					help='Output dir for storing files for validation (with trailing slash)')
parser.add_argument('output_dir_test', type=str,
					help='Output dir for storing test files (with a trailing slash)')
parser.add_argument('train_split', type=float,
					help='a float value for deciding percentage of data split for training the model')
parser.add_argument('dev_split', type=float,
					help='a float value for deciding percentage of validation data')
parser.add_argument('test_split', type=float,
					help='a float value for deciding percentage of test data')

args = parser.parse_args()

# Set default locations
video_dir = "data/RHL_mp4/"
json_dir = "data/RHL_json/" 
audio_dir = "data/RHL_wav/"

# Percentages/ratios should add up to 1.0 
if args.train_split + args.dev_split + args.test_split != 1.0:
	print "Make sure that train, test, and dev split ratios add upto 1.0"
	exit()

# Convert any mp4 found in data/RHL_mp4/ and store it in data/RHL_wav/
data_preprocessing.convert_mp4(video_dir, audio_dir)
print "[INFO]: Main video files converted to .wav files. Now splitting starts."

# Split all big wav files at data/RHL_wav/ and stores them at proper locations.(data/clean_data/ by default)

data_preprocessing.split_aligned_audio(audio_dir, 