Line #131 is wrong because the RecordCallBack expects the final parameter to be a pointer to the stream, but your code is passing a null pointer which results in an access violation.
The correct line is:
if (!mic.OpenDevice(device_index, mic_sample_rate, 1, RecordCallback, s.get())) {
Line #131 is wrong because the RecordCallBack expects the final parameter to be a pointer to the stream, but your code is passing a null pointer which results in an access violation.
The correct line is:
if (!mic.OpenDevice(device_index, mic_sample_rate, 1, RecordCallback, s.get())) {