@@ -81,6 +81,19 @@ static mp_obj_t audiomixer_mixervoice_obj_stop(size_t n_args, const mp_obj_t *po
81
81
}
82
82
MP_DEFINE_CONST_FUN_OBJ_KW (audiomixer_mixervoice_stop_obj , 1 , audiomixer_mixervoice_obj_stop );
83
83
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
+
84
97
//| level: synthio.BlockInput
85
98
//| """The volume level of a voice, as a floating point number between 0 and 1. If your board
86
99
//| 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[] = {
140
153
// Methods
141
154
{ MP_ROM_QSTR (MP_QSTR_play ), MP_ROM_PTR (& audiomixer_mixervoice_play_obj ) },
142
155
{ 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 ) },
143
157
144
158
// Properties
145
159
{ MP_ROM_QSTR (MP_QSTR_playing ), MP_ROM_PTR (& audiomixer_mixervoice_playing_obj ) },
0 commit comments