Bugfix and audio optimizations

Changed to 48 kHz and reduced Buffersize to 128 for less delay in the beginning.
This commit is contained in:
Thomas Herrmann 2022-03-31 00:40:07 +02:00
parent ff46b035d4
commit e282eb960c
2 changed files with 4 additions and 5 deletions

BIN
dist/underbridge.exe vendored

Binary file not shown.

View File

@ -159,15 +159,14 @@ def start_Rec():
global j global j
global pro global pro
global pattern_nr global pattern_nr
CHUNK = 1024 CHUNK = 128
FORMAT = pyaudio.paInt16 FORMAT = pyaudio.paInt16
CHANNELS = 2 CHANNELS = 2
RATE = 44100 RATE = 48000
RECORD_SECONDS = loop_time RECORD_SECONDS = loop_time
WAVE_OUTPUT_FILENAME = name_input.get()+ "_" + "track" + str(j+1) + ".wav" WAVE_OUTPUT_FILENAME = name_input.get()+ "_" + "track" + str(j+1) + ".wav"
p = pyaudio.PyAudio() p = pyaudio.PyAudio()
start_MIDI()
stream = p.open(format=FORMAT, stream = p.open(format=FORMAT,
channels=CHANNELS, channels=CHANNELS,
rate=RATE, rate=RATE,
@ -178,7 +177,7 @@ def start_Rec():
#print("* recording") #print("* recording")
frames = [] frames = []
start_MIDI()
for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)): for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
data = stream.read(CHUNK) data = stream.read(CHUNK)
frames.append(data) frames.append(data)