fixed folder creation

This commit is contained in:
Thomas Herrmann 2022-03-28 15:41:09 +02:00
parent 4f729aaac8
commit bd5a095e84

View File

@ -113,8 +113,9 @@ def makeDir():
def makeDirNr(pattern_nr): def makeDirNr(pattern_nr):
global projectpath global projectpath
projectpath = projectpath + '/' + str(pattern_nr) #Pfad wird addiert deswegen zusötzliche verzeichnisse #Pfad wird addiert deswegen zusätzliche verzeichnisse
os.mkdir(projectpath) #projectpath = projectpath + '/' + str(pattern_nr)
os.mkdir(projectpath + '/' + str(pattern_nr))
print(projectpath) print(projectpath)
def start_Rec(): def start_Rec():
@ -123,6 +124,7 @@ def start_Rec():
global time global time
global j global j
global pro global pro
global pattern_nr
CHUNK = 1024 CHUNK = 1024
FORMAT = pyaudio.paInt16 FORMAT = pyaudio.paInt16
CHANNELS = 2 CHANNELS = 2
@ -152,14 +154,19 @@ def start_Rec():
stream.stop_stream() stream.stop_stream()
stream.close() stream.close()
p.terminate() p.terminate()
if mode_select.get() == 2:
wf = wave.open(projectpath + '/' + str(pattern_nr) + '/' + WAVE_OUTPUT_FILENAME, 'wb')
else:
wf = wave.open(projectpath + '/' + WAVE_OUTPUT_FILENAME, 'wb') wf = wave.open(projectpath + '/' + WAVE_OUTPUT_FILENAME, 'wb')
wf.setnchannels(CHANNELS) wf.setnchannels(CHANNELS)
wf.setsampwidth(p.get_sample_size(FORMAT)) wf.setsampwidth(p.get_sample_size(FORMAT))
wf.setframerate(RATE) wf.setframerate(RATE)
wf.writeframes(b''.join(frames)) wf.writeframes(b''.join(frames))
wf.close() wf.close()
j = j + 1 j = j + 1
if j == 8:
j= 0
displaymsg.set("End of Recording") displaymsg.set("End of Recording")
def sequenceMaster(): def sequenceMaster():