pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

Recording extension: Set Sample Rate block not implemented in simulator

Open microbit-carlos opened this issue 2 years ago • 2 comments

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:

  1. Add recording extension
  2. Add the code below
  3. Try it on the sim
  4. The playback is not at twice the speed
image
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

microbit-carlos avatar Jun 26 '23 17:06 microbit-carlos

@riknoll is this just calling an api in webaudio?

https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext

abchatra avatar Oct 20 '23 16:10 abchatra

@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

microbit-carlos avatar Apr 03 '24 14:04 microbit-carlos