def main(json_dir, out_dir):
    ' Script to convert all .json files in json_dir into corresponding .mat\n        files in out_dir\n\n    .mat files have the same basename as the .json files\n\n    This script is meant for data files that contain data from\n    OpenSauce / VoiceSauce variables.\n    '
    json_files = glob.glob(os.path.join(json_dir, '*.json'))
    for json_file in json_files:
        with open(json_file) as f:
            json_dict = json.load(f)
        if (not os.path.isdir(out_dir)):
            os.makedirs(out_dir)
        fn = (os.path.join(out_dir, os.path.splitext(os.path.basename(json_file))[0]) + '.mat')
        savemat(fn, json_dict)
        print('Wrote data in {} to {}'.format(json_file, fn))
Script to convert all .json files in json_dir into corresponding .mat
    files in out_dir

.mat files have the same basename as the .json files

This script is meant for data files that contain data from
OpenSauce / VoiceSauce variables.
def main(json_dir, out_dir):
    ' Script to convert all .json files in json_dir into corresponding .mat\n        files in out_dir\n\n    .mat files have the same basename as the .json files\n\n    This script is meant for data files that contain data from\n    OpenSauce / VoiceSauce variables.\n    '
    json_files = glob.glob(os.path.join(json_dir, '*.json'))
    for json_file in json_files:
        with open(json_file) as f:
            json_dict = json.load(f)
        if (not os.path.isdir(out_dir)):
            os.makedirs(out_dir)
        fn = (os.path.join(out_dir, os.path.splitext(os.path.basename(json_file))[0]) + '.mat')
        savemat(fn, json_dict)
        print('Wrote data in {} to {}'.format(json_file, fn))