1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 
5 #include "py/builtin.h"
6 #include "py/mperrno.h"
7 #include "py/obj.h"
8 #include "py/runtime.h"
9 #include "ulog/ulog.h"
10 
11 extern const mp_obj_type_t uvoice_snd_type;
12 extern const mp_obj_type_t uvoice_player_type;
13 extern const mp_obj_type_t uvoice_recorder_type;
14 extern const mp_obj_type_t uvoice_tts_type;
15 
16 // this is the actual C-structure for our new object
17 STATIC const mp_rom_map_elem_t uvoice_locals_dict_table[] = {
18     { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audio) },
19     { MP_OBJ_NEW_QSTR(MP_QSTR_Snd), MP_ROM_PTR(&uvoice_snd_type) },
20     { MP_OBJ_NEW_QSTR(MP_QSTR_Player), MP_ROM_PTR(&uvoice_player_type) },
21     { MP_OBJ_NEW_QSTR(MP_QSTR_Recorder), MP_ROM_PTR(&uvoice_recorder_type) },
22     { MP_OBJ_NEW_QSTR(MP_QSTR_Tts), MP_ROM_PTR(&uvoice_tts_type) },
23 };
24 
25 STATIC MP_DEFINE_CONST_DICT(uvoice_locals_dict, uvoice_locals_dict_table);
26 
27 const mp_obj_module_t audio_module = {
28     .base = { &mp_type_module },
29     .globals = (mp_obj_dict_t *)&uvoice_locals_dict,
30 };