4343//|
4444//| AudioOut can be used to output an analog audio signal on a given pin.
4545//|
46- //| .. class:: AudioOut(left_channel, *, right_channel=None, default_value =0x8000)
46+ //| .. class:: AudioOut(left_channel, *, right_channel=None, quiescent_value =0x8000)
4747//|
4848//| Create a AudioOut object associated with the given pin(s). This allows you to
4949//| play audio signals out on the given pin(s).
5050//|
5151//| :param ~microcontroller.Pin left_channel: The pin to output the left channel to
5252//| :param ~microcontroller.Pin right_channel: The pin to output the right channel to
53- //| :param int default_value : The default output value. Samples should start and end with this
54- //| value to prevent popping.
53+ //| :param int quiescent_value : The output value when no signal is present. Samples should start
54+ //| and end with this value to prevent audible popping.
5555//|
5656//| Simple 8ksps 440 Hz sin wave::
5757//|
@@ -97,11 +97,11 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar
9797 mp_arg_check_num (n_args , n_kw , 1 , 2 , true);
9898 mp_map_t kw_args ;
9999 mp_map_init_fixed_table (& kw_args , n_kw , pos_args + n_args );
100- enum { ARG_left_channel , ARG_right_channel , ARG_default_value };
100+ enum { ARG_left_channel , ARG_right_channel , ARG_quiescent_value };
101101 static const mp_arg_t allowed_args [] = {
102102 { MP_QSTR_left_channel , MP_ARG_OBJ | MP_ARG_REQUIRED },
103103 { MP_QSTR_right_channel , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_rom_obj = mp_const_none } },
104- { MP_QSTR_default_value , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_int = 0x8000 } },
104+ { MP_QSTR_quiescent_value , MP_ARG_OBJ | MP_ARG_KW_ONLY , {.u_int = 0x8000 } },
105105 };
106106 mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
107107 mp_arg_parse_all (n_args , pos_args , & kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
@@ -120,7 +120,7 @@ STATIC mp_obj_t audioio_audioout_make_new(const mp_obj_type_t *type, size_t n_ar
120120 // create AudioOut object from the given pin
121121 audioio_audioout_obj_t * self = m_new_obj (audioio_audioout_obj_t );
122122 self -> base .type = & audioio_audioout_type ;
123- common_hal_audioio_audioout_construct (self , left_channel_pin , right_channel_pin , args [ARG_default_value ].u_int );
123+ common_hal_audioio_audioout_construct (self , left_channel_pin , right_channel_pin , args [ARG_quiescent_value ].u_int );
124124
125125 return MP_OBJ_FROM_PTR (self );
126126}
0 commit comments