Skip to content

Commit 3c12844

Browse files
committed
pybricks.common.Speaker: Allow sounds to cancel each other.
This appears to be the more intuitive behavior, similar to motors.
1 parent c215ca2 commit 3c12844

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pybricks/common/pb_type_speaker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ STATIC mp_obj_t pb_type_Speaker_beep(size_t n_args, const mp_obj_t *pos_args, mp
166166
pb_type_Speaker_beep_test_completion,
167167
pb_type_awaitable_return_none,
168168
pb_type_Speaker_cancel,
169-
PB_TYPE_AWAITABLE_OPT_RAISE_ON_BUSY);
169+
PB_TYPE_AWAITABLE_OPT_CANCEL_ALL);
170170
}
171171
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pb_type_Speaker_beep_obj, 1, pb_type_Speaker_beep);
172172

@@ -382,7 +382,7 @@ STATIC mp_obj_t pb_type_Speaker_play_notes(size_t n_args, const mp_obj_t *pos_ar
382382
pb_type_Speaker_notes_test_completion,
383383
pb_type_awaitable_return_none,
384384
pb_type_Speaker_cancel,
385-
PB_TYPE_AWAITABLE_OPT_RAISE_ON_BUSY);
385+
PB_TYPE_AWAITABLE_OPT_CANCEL_ALL);
386386
}
387387
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pb_type_Speaker_play_notes_obj, 1, pb_type_Speaker_play_notes);
388388

0 commit comments

Comments
 (0)