-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
40 lines (38 loc) · 1.78 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import common
import confirm_use
def compare(path1, path2):
# 刪除已有的資料夾重新創建
musicPath = common.folderRemake()
# process start
common.filterOther(path1)
fileName1 = common.fileNameCatch(path1)
tempPath1 = common.pathSplice(musicPath, fileName1)
common.mkMusicDir(tempPath1, "mp3")
common.mkMusicDir(tempPath1, "wav")
mp3FilePath1 = common.transferMP3(path1, tempPath1)
wavFilePath1 = common.transferWAV(path1, tempPath1)
mp3FileList1 = common.sortList(mp3FilePath1)
wavFileList1 = common.sortList(wavFilePath1)
assert len(mp3FileList1) == len(wavFileList1), "numbers of file not equal"
mp3Data1, wavData1 = common.parseMusic(mp3FileList1, wavFileList1)
curList1 = common.dataSplice(mp3Data1, wavData1)
# ----------------------------------------------------------------------
common.filterOther(path2)
fileName2 = common.fileNameCatch(path2)
tempPath2 = common.pathSplice(musicPath, fileName2)
common.mkMusicDir(tempPath2, "mp3")
common.mkMusicDir(tempPath2, "wav")
mp3FilePath2 = common.transferMP3(path2, tempPath2)
wavFilePath2 = common.transferWAV(path2, tempPath2)
mp3FileList2 = common.sortList(mp3FilePath2)
wavFileList2 = common.sortList(wavFilePath2)
assert len(mp3FileList2) == len(wavFileList2), "numbers of file not equal"
mp3Data2, wavData2 = common.parseMusic(mp3FileList2, wavFileList2)
curList2 = common.dataSplice(mp3Data2, wavData2)
# ----------------------------------------------------------------------
confirmList = confirm_use.get_confirm_fftdata(curList1, curList2)
common.createLog(confirmList)
if __name__ == '__main__':
path1 = r"C:\音樂測試使用\龍神\tu001"
path2 = r"C:\音樂測試使用\龍神\tu002"
compare(path1, path2)