From df66c6fd5a084870fb19baad508c962f6a61d51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Oesterwind?= Date: Fri, 25 Jun 2021 23:30:59 +0200 Subject: [PATCH] Made it more comprehensible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sören Oesterwind --- audioCircReplayTest.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/audioCircReplayTest.py b/audioCircReplayTest.py index b78ab77..0ef20ff 100644 --- a/audioCircReplayTest.py +++ b/audioCircReplayTest.py @@ -1,12 +1,17 @@ +# Original code by TheGreydiamond Copyright 2020-2021 import pyaudio, numpy, keyboard, time import scipy.io.wavfile as wav from sys import getsizeof -RATE=48000 -RECORD_SECONDS = 20 -CHUNKSIZE = 1024*2 +##### CONFIG ##### -SourcesToRecord = ["VoiceMeeter VAIO3 Output", "Aux"] +RATE=48000 # Sample rate +RECORD_SECONDS = 20 # Seconds to record (aka. last X seconds) +SourcesToRecord = ["VoiceMeeter VAIO3 Output", "Aux"] # Record all sources which contains these strings + +##### CONFIG END (aka. DO NOT FRICKING TOUCHY) ##### + +CHUNKSIZE = 1024*2 print("Searching for audio sources") Sources = [] AudioChannels = [] @@ -20,6 +25,7 @@ cleanUp = False incomingAudioChan = -1 localAudioChan = -1 +## Find the acutal device pointers for i in range(0, numdevices): if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0: i2 = 0 @@ -36,6 +42,7 @@ while(i <= len(SourcesToRecord)): Frames.append([]) i += 1 +# Save the replay def on_triggered(): global cb, saves print("Saving replay..", end = "")