@@ -81,6 +81,19 @@ static mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po
8181}
8282MP_DEFINE_CONST_FUN_OBJ_KW (audiomixer_mixervoice_stop_obj , 1 , audiomixer_mixervoice_obj_stop );
8383
84+ //| def end(self) -> None:
85+ //| """ Sets looping to False if sample is playing. This allows the looped
86+ //| sample to complete its current playback and end further looping """
87+ //| ...
88+ //|
89+ static mp_obj_t audiomixer_mixervoice_obj_end (mp_obj_t self_in ) {
90+ audiomixer_mixervoice_obj_t * self = MP_OBJ_TO_PTR (self_in );
91+ common_hal_audiomixer_mixervoice_end (self );
92+ return mp_const_none ;
93+ }
94+ MP_DEFINE_CONST_FUN_OBJ_1 (audiomixer_mixervoice_end_obj , audiomixer_mixervoice_obj_end );
95+
96+
8497//| level: synthio.BlockInput
8598//| """The volume level of a voice, as a floating point number between 0 and 1. If your board
8699//| does not support synthio, this property will only accept a float value.
@@ -140,6 +153,7 @@ static const mp_rom_map_elem_t audiomixer_mixervoice_locals_dict_table[] = {
140153 // Methods
141154 { MP_ROM_QSTR (MP_QSTR_play ), MP_ROM_PTR (& audiomixer_mixervoice_play_obj ) },
142155 { MP_ROM_QSTR (MP_QSTR_stop ), MP_ROM_PTR (& audiomixer_mixervoice_stop_obj ) },
156+ { MP_ROM_QSTR (MP_QSTR_end ), MP_ROM_PTR (& audiomixer_mixervoice_end_obj ) },
143157
144158 // Properties
145159 { MP_ROM_QSTR (MP_QSTR_playing ), MP_ROM_PTR (& audiomixer_mixervoice_playing_obj ) },
0 commit comments