diff --git a/README.MD b/README.MD index 814df87..db43788 100644 --- a/README.MD +++ b/README.MD @@ -1 +1,13 @@ -# Audio sampler \ No newline at end of file +# Audio sampler +Audio sampler is a tool to record the last `SecondsToRecord` from one or multiple sources. This utility will only record at max stereoaudio. + +## Config +`SampleRate` the sample rate to record with, recommended default is `48000` + +`SecondsToRecord` amount of seconds to keep in memory and save when triggered. + +`SourcesToRecord` a list of audiodevices which will be recorded. + +`SaveDirectory` the path of the save folder, meaning the folder they will be saved in. + +`Shortcut` the shortcut which will trigger to save the recording. \ No newline at end of file diff --git a/audioCircReplayTest.py b/audioCircReplayTest.py index 7e1fbb0..dae6e48 100644 --- a/audioCircReplayTest.py +++ b/audioCircReplayTest.py @@ -22,26 +22,27 @@ conf = json.loads(data) RATE = conf["SampleRate"] # Sample rate RECORD_SECONDS = conf["SecondsToRecord"] # Seconds to record (aka. last X seconds) SourcesToRecord = conf["SourcesToRecord"] # Record all sources which contains these strings -SaveDirectory= conf["SaveDirectory"] -shortcut = conf["Shortcut"] +SaveDirectory= conf["SaveDirectory"] # The directory to save to +shortcut = conf["Shortcut"] # The shortcut to trigger the save -##### CONFIG END (aka. DO NOT FRICKING TOUCHY) ##### +##### CONFIG END ##### CHUNKSIZE = 1024*2 + print("Searching for audio sources") Sources = [] AudioChannels = [] Frames = [] -p = pyaudio.PyAudio() +p = pyaudio.PyAudio() # An instance of PyAudio info = p.get_host_api_info_by_index(0) -numdevices = info.get('deviceCount') +numdevices = info.get('deviceCount') # The amount of audio devices samplesI = 0 saves = 0 cleanUp = False incomingAudioChan = -1 localAudioChan = -1 -## Find the acutal device pointers +## Find the actual 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