# Path: src/component/OutputFilenameComponent.py
# class OutputFilenameComponent(object):
#     """
#     docstring
#     """
#     @staticmethod
#     def can_get_wav_file_name(nameLists: Tuple[List[str], Dict[int, str]]) -> bool:
#         wavFileNames = nameLists[0]
#         filenames = nameLists[1]
#         if len(wavFileNames) > len(filenames):
#             return False
#         else:
#             return True
# 
#     @staticmethod
#     def awb_file(path: str) -> int:
#         if os.path.splitext(os.path.basename(path))[1].lower() == ".awb":
#             return 1
#         elif os.path.basename(path).lower().endswith("awb.txt"):
#             return 2
#         else:
#             return 0


import os
from typing import Dict, List, Tuple
from src.component.FileAnalyzeComponent import FileAnalyzeComponent
from src.component.OutputFilenameComponent import OutputFilenameComponent
        if end is None:
            return dict()
        with open(filename, 'rb') as f:
            f.seek(offset)
            stri = f.read(end - offset)
            names = stri.split('\x00'.encode('ascii'))
        indexList = FileAnalyzeComponent.get_filename_index(filename, offset1, offset2)
        print("名前の数" + str(len(names)))
        print("indexの数" + str(len(indexList)))
        ret = {}
        count = 0
        for name in names:
            try:
                index = indexList[count]
            except Exception as e:
                index = 'unknown index:' + str(count)
            ret[index] = name.decode('utf-8')
            count = count + 1
        return ret

    @staticmethod
    def get_wav_file_names(path: str, fileList: List[str]) -> Tuple[List[str], Dict[int, str]]:
        # 連番の名前
        wavFileNames = [os.path.splitext(file)[0] + '.wav' for file in fileList]

        # acbファイルに格納されている元の名前
        filenames = OutputFilenameService.get_filename(path)

        # 調査したのがawbファイルで元ファイル名が見つからない場合acbファイルも調査する
        if len(filenames) == 0 and OutputFilenameComponent.awb_file(path) != 0:

# Path: src/component/OutputFilenameComponent.py
# class OutputFilenameComponent(object):
#     """
#     docstring
#     """
#     @staticmethod
#     def can_get_wav_file_name(nameLists: Tuple[List[str], Dict[int, str]]) -> bool:
#         wavFileNames = nameLists[0]
#         filenames = nameLists[1]
#         if len(wavFileNames) > len(filenames):
#             return False
#         else:
#             return True
# 
#     @staticmethod
#     def awb_file(path: str) -> int:
#         if os.path.splitext(os.path.basename(path))[1].lower() == ".awb":
#             return 1
#         elif os.path.basename(path).lower().endswith("awb.txt"):
#             return 2
#         else:
#             return 0


# Path: src/service/OutputFilenameService.py
import os
from typing import Dict, List, Tuple
from src.component.FileAnalyzeComponent import FileAnalyzeComponent
from src.component.OutputFilenameComponent import OutputFilenameComponent

        if end is None:
            return dict()
        with open(filename, 'rb') as f:
            f.seek(offset)
            stri = f.read(end - offset)
            names = stri.split('\x00'.encode('ascii'))
        indexList = FileAnalyzeComponent.get_filename_index(filename, offset1, offset2)
        print("名前の数" + str(len(names)))
        print("indexの数" + str(len(indexList)))
        ret = {}
        count = 0
        for name in names:
            try:
                index = indexList[count]
            except Exception as e:
                index = 'unknown index:' + str(count)
            ret[index] = name.decode('utf-8')
            count = count + 1
        return ret

    @staticmethod
    def get_wav_file_names(path: str, fileList: List[str]) -> Tuple[List[str], Dict[int, str]]:
        # 連番の名前
        wavFileNames = [os.path.splitext(file)[0] + '.wav' for file in fileList]

        # acbファイルに格納されている元の名前
        filenames = OutputFilenameService.get_filename(path)

        # 調査したのがawbファイルで元ファイル名が見つからない場合acbファイルも調査する
        if len(filenames) == 0 and OutputFilenameComponent.awb_file(path) != 0:

            if OutputFilenameComponent.awb_file(path) == 1: