Multiple calls to audio.play(wait=False)
and microphone.record_into(wait=False)
#198
Labels
enhancement
New feature or request
Milestone
Multiple subsequent calls to
audio.play(buffer, wait=False)
andmicrophone.record_into(buffer, wait=False)
will cancel the current playback/recording and start the new one immediately.This is very likely the user expectation, and if we wanted to block until the previous call finishes we can always wait with the
audio.is_playing()
andmicrohone.is_recording()
functions.However, when first building a programmes using
wait=False
, we found ourselves in situations where "blocking with a queue of 1" was useful. This is the approached we ended up following in CODAL as well for some of the async audio functionality.For example, to illustrate what I mean I'll change the
wait
parameter with a new value:So, for a loop like this one:
We might end up having to do something like:
And we think that some of the audio clicks we hear when trying to constantly transmit and play audio data via radio (walkie-talkie projects) might be produced between the
while is_recording()
and therecord_into()
, or in the case of playback, betweenwhile is_playing()
andaudio.play()
.The text was updated successfully, but these errors were encountered: