File size: 584 Bytes
59e1d08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from tool.file_name import *
import os
import json


def load_groups_json():
    if not os.path.exists(dir_sample_groups_json) or not os.path.exists(dir_speaker_groups_json):
        print("JSON file doesn't exist")
        return [], {}

    with open(dir_sample_groups_json, "r", encoding="utf-8") as json_file_sample:
        sample_groups_list: list = json.load(json_file_sample)
    with open(dir_speaker_groups_json, "r", encoding="utf-8") as json_file_speaker:
        speaker_groups_dict: dict = json.load(json_file_speaker)
    return sample_groups_list, speaker_groups_dict