microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
726 stars 638 forks source link

Microphone level maxes out at ~191 on hardware #4381

Open microbit-mark opened 3 years ago

microbit-mark commented 3 years ago

Writing the value of sound level to serial, the loudest sound level returned seems to be between 191-195. The returned level should be up to 255

image

https://makecode.microbit.org/_LMvK17UKMaeA

Does not reproduce in MicroPython, so I assume this is MakeCode related, not CODAL.

microbit-mark commented 3 years ago

@abchatra can you take a look at this one and try and reproduce?

abchatra commented 2 years ago

Does this not reproduce in python when writing to serial? Does this reproduce if we don't write to serial but just displayed on the screen?

I will take a look.

jaustin commented 9 months ago

@microbit-carlos do you think this is still an issue?

microbit-carlos commented 9 months ago

This was fixed in CODAL in:

As part of that MakeCode should have been updated to use uBit.audio.levelSPL->setUnit(LEVEL_DETECTOR_SPL_8BIT) as described in https://github.com/lancaster-university/codal-microbit-v2/issues/225#issuecomment-1241023894, which I think it might not have been implemented yet: https://github.com/microsoft/pxt-microbit/blob/v6.1.8/libs/microphone/microphone.cpp