Closed microbit-carlos closed 2 months ago
This is not related to the audio-recording branch, it's a bug in the master branch.
Now fixed on master by c143b24acf26fdebc6eb965c625430521d4a0c21
Sorry, I forgot to mention that microphone.stop_recording()
didn't work either:
>>> a = microphone.record(4000)
>>> # Recording plays for 4 seconds instead of 1
>>> audio.play(a, wait=False); sleep(1000); microphone.stop_recording()
>>>
I'm not sure what's wrong with the above code. It should play for 4 seconds. The microphone.record()
is synchronous and records for 4 seconds, then the audio.play()
will play the full sample, because microphone.stop_recording()
has no effect on audio playback.
Oh yes, you are right, brain fart from my side!
Tested with v2.1.2 and the lates recording&playback branch.
audio.stop
doesn't work in this example:Simpler example in REPL (the next prompt
>>>
appears before the sound naturally ends playing):Replacing the play call with
audio.play(audio.SoundEffect(duration=3000), wait=False)
doesn't work either.