I'm updating the AudioRecorder.py to record as a wav (so that wave module can get raw samples for plotting/visualization). Also, I wanted to use recordForDuration instead of record.
I'm trying to understand how to pass an argument to the function. The prototype is:
(BOOL)recordForDuration:(NSTimeInterval)duration
where
typedef double NSTimeInterval;
I thought in ctypes I would use this as follows:
started_recording=msg(recorder, c_bool, 'recordForDuration',[c_double], 1.0)
to record for 1 second. Is this the right way to pass a double into this function?
This call crashes pythonista. Strangely, after I reopen pythonista, the recorded file is exactly 1 second, so it seems like it is working, but just also crashing.
Any thoughts?