I would like to use the "out" parameter to write a recorded signal to a given numpy array but I don't get any audio appended to the array I am passing it. Should a samplerate be defined if I want it to use the default samplerate? There is no specific example usage in the documentation so if there any suggestions about proper usage please see the example below:
import sounddevice as sd
import numpy as np
import time
input_chs = [1,2]
rec_array = np.zeros([1, len(input_chs)])
sd.rec(out=rec_array, mapping=input_chs)
time.sleep(1)
sd.stop()
print(rec_array) # Returns original rec_array
I also tried
rec_array = sd.rec(out=rec_array, mapping=input_chs)
but the results were the same.