lancaster-university / codal-microbit-v2

CODAL target for the micro:bit v2.x series of devices
MIT License
41 stars 50 forks source link

channel->requestSampleRate wakes the mic without any way to turn off again #335

Closed JohnVidler closed 1 year ago

JohnVidler commented 1 year ago

As setSampleRate wakes the microphone, but doesn't actually set any buffers moving down the stream API, the event handlers to turn the microphone back off never actually get calls (they're part of the pipeline at the output stage of the mic, so only run when a buffer appears)

The upshot of this is that setting a sample rate will wake the mic, and keep it awake forever (until something actually uses the mic)

JohnVidler commented 1 year ago

This is fixed in master; creating a new channel and setting the sample rate no longer results in a wake event for the mic.

Closing as fixed.