Made it more comprehensible
Signed-off-by: Sören Oesterwind <grey@noreply.git.thegreydiamond.de>
This commit is contained in:
@ -1,12 +1,17 @@
|
|||||||
|
# Original code by TheGreydiamond Copyright 2020-2021
|
||||||
import pyaudio, numpy, keyboard, time
|
import pyaudio, numpy, keyboard, time
|
||||||
import scipy.io.wavfile as wav
|
import scipy.io.wavfile as wav
|
||||||
from sys import getsizeof
|
from sys import getsizeof
|
||||||
|
|
||||||
RATE=48000
|
##### CONFIG #####
|
||||||
RECORD_SECONDS = 20
|
|
||||||
CHUNKSIZE = 1024*2
|
|
||||||
|
|
||||||
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")
|
print("Searching for audio sources")
|
||||||
Sources = []
|
Sources = []
|
||||||
AudioChannels = []
|
AudioChannels = []
|
||||||
@ -20,6 +25,7 @@ cleanUp = False
|
|||||||
incomingAudioChan = -1
|
incomingAudioChan = -1
|
||||||
localAudioChan = -1
|
localAudioChan = -1
|
||||||
|
|
||||||
|
## Find the acutal device pointers
|
||||||
for i in range(0, numdevices):
|
for i in range(0, numdevices):
|
||||||
if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
|
if (p.get_device_info_by_host_api_device_index(0, i).get('maxInputChannels')) > 0:
|
||||||
i2 = 0
|
i2 = 0
|
||||||
@ -36,6 +42,7 @@ while(i <= len(SourcesToRecord)):
|
|||||||
Frames.append([])
|
Frames.append([])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
# Save the replay
|
||||||
def on_triggered():
|
def on_triggered():
|
||||||
global cb, saves
|
global cb, saves
|
||||||
print("Saving replay..", end = "")
|
print("Saving replay..", end = "")
|
||||||
|
Reference in New Issue
Block a user