Allow simulator to behave correctly when used with audio play/record extensions using new CODAL pipeline
Is your feature request related to a problem? Please describe.
There's a new audio pipeline going into CODAL that will allow, amongst other things, playback and record of audio, and some more dynamic behaviour for the audio pipeline. For example, if a user 'listens' for 3 seconds to store a clip in RAM, the microphone will only be powered for those 3 seconds, and consequently the micro:bits microphone LED will only be on during that time.
As yet, the simulator doesn't implement anything relating to these new CODAL APIs and the recording LED, nor the ability to record sound.
We're developing these APIs as an extension, but would like the simulator to do 'the right thing' so users don't get vastly different experiences on the simulator and the device.
Describe the solution you'd like
Ultimately, I'd like the simulator to be able to record audio and play it back. I understand that may be a longer term goal.
However, in the short term, it may suffice for the simulator's microphone LED to activate and deactivate at appropriate times.
- Should this be under the control of the simulator
- Or should we push the responsibility to the extension to have a different codepath under simulation that is responsible for faking microphone LED state?
- If the latter, is that API already exposed to the extensions?
Describe alternatives you've considered
-
Doing nothing: We think this will be confusing for users and make it hard for us to user test the recording blocks
-
Having a fixed sample that is always 'recorded' and played back I think this would work quite nicely but in conjunction with #4609 could be implemented 'extension side' not necessarily in MakeCode itself. (This would allow user changes of sample rate etc to be experimented with even in absence of real recording
@riknoll @johnvidler has more information on the pipeline stuff.
@riknoll some of the team had noticed this https://github.com/microsoft/pxt/pull/8773 and wondered whether that gives us an easy to use thing for this?
This is asking for simulator support for record playback api