pxt-microbit
pxt-microbit copied to clipboard
Recording extension: Set Sample Rate block not implemented in simulator
Describe the bug I believe the sample rate blocks have not implemented in the simulator in the 2023 release yet.
~~If that's the case there should probably be some kind of UX to let the user know this? Otherwise it looks like the code is not working as expected, which can be quite frustrating if you think there is a bug in your code.~~
2024 edit: Can we implement this feature in the simulator for the 2024 release?
To Reproduce Steps to reproduce the behavior:
- Add recording extension
- Add the code below
- Try it on the sim
- The playback is not at twice the speed
input.onButtonPressed(Button.A, function () {
record.startRecording(record.BlockingState.Blocking)
record.playAudio(record.BlockingState.Blocking)
})
record.setSampleRate(22000, record.AudioSampleRateScope.Playback)
Expected behavior The sample rate features to work on the simulator.
Screenshots Already added.
micro:bit version (please complete the following information):
V2.x
Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome 114
Smartphone (please complete the following information): N/A
Additional context makecode.microbit.org version: 6.0.10 Microsoft MakeCode version: 9.0.7 microbit runtime version: v2.2.0-rc6 codal-microbit-v2 runtime version: v0.2.55
Edit: Tried it again in: makecode.microbit.org version: 6.0.25 Microsoft MakeCode version: 9.0.15 microbit runtime version: v2.2.0-rc6 codal-microbit-v2 runtime version: v0.2.63
Related to:
- https://github.com/microsoft/pxt-microbit/issues/5581
@riknoll is this just calling an api in webaudio?
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext
@abchatra I've updated the issue description to reflect the request to implement this feature in the simulator. Also created this issue for the gain block:
- https://github.com/microsoft/pxt-microbit/issues/5581