I am using PyAudio to detect system sounds produced by my computer and save it into a file. Only sounds originating from the computer will be detected so if a dog barks, it will go ignored by the program.
Given this setup, I think that complete silence is record-able since if the computer makes no sound, then no sound will be detected.
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
input=True,
frames_per_buffer=CHUNK,
input_device_index=dev_index
)
for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
data = stream.read(CHUNK)
frames.append(data)
From my knowledge, every "chunk" of sound is stored in data
which is them appended to frames
. I was wondering how I could use data
to see if certain sounds were playing or if no sound was playing at all? I have tried printing data
but sometime the same silence results in different things being printed.