Closed microbit-mark closed 1 year ago
We should auto turn off the microphone when I paging a sound
From: Mark notifications@github.com Sent: Friday, November 27, 2020 4:53:45 PM To: microsoft/pxt-microbit pxt-microbit@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [microsoft/pxt-microbit] onSound triggers constantly if playing melody on the spseaker (#3777)
Describe the bug A clear and concise description of what the bug is.
This program triggers the sound playback constantly
But set threshold is not a kid-friendly block for first using the microphone and it's hidden away in Input > more
Could we change the default threshold so it does not trigger so easily.
...or we could have a mic on/off block ... or lower the volume of the melody
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-microbit%2Fissues%2F3777&data=04%7C01%7Cjhalleux%40microsoft.com%7C1043f4b13b5b413dc74208d892ec9fe2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637420892331152720%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2B9laMTCZdSO1m5rDRN0Hg1%2BWCnnu2MB0vT1g%2Fqag5Qg%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKO67UE6ZAD35BMTY3LSR7DQTANCNFSM4UFB7INA&data=04%7C01%7Cjhalleux%40microsoft.com%7C1043f4b13b5b413dc74208d892ec9fe2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637420892331152720%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7NdxgGJA4Bv40c4uBtbZsuuq5vwhebNNL9RGYN489p8%3D&reserved=0.
@finneyj is there an easy way just to ignore mic events during sound playing? I would rather not actually turn off the microphone
Sounds like a "learning opportunity" about feedback loops.. :)
We could suppress the generation of events, for sure... but I think there's a problem here around making too many assumptions... Kids won't expect the microphone to be enabled/disabled without them knowing.
There could be use cases where disabling the mic events could break kids code. e.g. clap to stop sound? Music playing in a game, and a clap to activate a game activity? etc...
Alternative options:
Preserve the current behaviour and encourage kids to manually set threshold block anyway. Can we do tooltips if we see a block that makes a sound inside an "onLoud" handler?
Try to dynamically adjust the onLoud threshold based on sound output level. We calibrate for this (as all micro:bit are more or less created equal), but only for sound that go through the mixer (anyone sneaking around that to do old school v1 PWM sounds wouldn't work). Also if kids/teachers were using external speakers, that calibration would be no good, and you'll likely still get the same feedback loop. This would be less of a common case though I guess.
Add some sort of feedback suppression filter in software, like you do on your phone/laptop. I don't think we have the developer resource or CPU cycles to do that though.
A microphone mute block would match perfectly what they already use in Zoom/Teams/… every day.
From: Joe Finney notifications@github.com Reply-To: microsoft/pxt-microbit reply@reply.github.com Date: Friday, November 27, 2020 at 5:54 PM To: microsoft/pxt-microbit pxt-microbit@noreply.github.com Cc: Peli de Halleux jhalleux@microsoft.com, Comment comment@noreply.github.com Subject: Re: [microsoft/pxt-microbit] onSound triggers constantly if playing melody on the speaker (#3777)
Sounds like a "learning opportunity" about feedback loops.. :)
We could suppress the generation of events, for sure... but I think there's a problem here around making too many assumptions... Kids won't expect the microphone to be enabled/disabled without them knowing.
There could be use cases where disabling the mic events could break kids code. e.g. clap to stop sound? Music playing in a game, and a clap to activate a game activity? etc...
Alternative options:
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fpxt-microbit%2Fissues%2F3777%23issuecomment-734919818&data=04%7C01%7Cjhalleux%40microsoft.com%7Cc10d6e1546d043daf71908d892f51b96%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637420928707118522%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=RJwpfXLpKVurVGU1ZZ5FgUYuh55l5PbcXt3YGHiLpSg%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKOYIJBMBCFKU66CPTTSR7KULANCNFSM4UFB7INA&data=04%7C01%7Cjhalleux%40microsoft.com%7Cc10d6e1546d043daf71908d892f51b96%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637420928707118522%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pt43YLVdUJJZk%2FbRatHrPrdsblaPjCyl1Wle7yL6DZk%3D&reserved=0.
yep - mute would work.
Right, Joe and John implemented a function in CODAL to enable this. CODAL now has an 'is sound playing'
This is very specifically to allow users to mute the mic/ignore the mic when sound is playing from the micro:bit.
We should expose this as a block to users!
So then the question is should we still have a 'microphone mute' block as well or should we add a new sensitivity level to the microphone (set microphone sensitivity should be coming to 'input
as part of #4493
@finneyj there were also events for 'sound started' and 'silence started' - did you think we'd expose these too?
@abchatra this one is still a good issue and we now have the stuff we need in CODAL to address it. It becomes more relevant/prevalent with the audio record/playback stuff
Request is to add a block "sound playing" so users don't trigger additional things.
@abchatra any more thoughts on adding this?
I had already marked it for release. Someone will pick it up during bug fixing phase.
Great, and sorry, was looking for a 'next release' label, not the milestones. Oops. (looks like that was what we used last year!)
@srietkerk can you take this up? Basically we need to expose a new block "sound is playing" in Music category under Volume subcategory. Whenever a sound is playing this should return 1 other wise 0.
Yep, sounds good!
Describe the bug A clear and concise description of what the bug is.
This program triggers the sound playback constantly
Setting a higher threshold resolves this
But
set threshold
is not a kid-friendly block for a first time user of the microphone and it's hidden away in Input > moreCould we change the default threshold so it does not trigger so easily.
Some sub-optimal possibilities:
...or we could have a mic on/off block ... or lower the volume of the melody when using the mic blocks ... or move the set threshold block into the main V2 blocks