Record Audio - Blocking


(Joel) #1

Is there a way to record audio (from mic) in a blocking fashion. I would prefer to be notified each 1024 bytes, rather than polling which appears to be the only API. Does lock actually block?

So how to Synchronous instead of async?

Joel


(Mathew Block) #2

No, once microphone recording begins audio will be streamed in real-time. Lock will give you a pointer to the data but will not prevent more being written. The only way to halt the flow of data is by stopping the recording.

You would need to poll in the sleep loop to achieve synchronous behavior.