audiomp3: rename to MP3Decoder
This commit is contained in:
parent
bd8650d35b
commit
dc729718eb
@ -30,18 +30,16 @@
|
||||
#include "lib/utils/context_manager_helpers.h"
|
||||
#include "py/objproperty.h"
|
||||
#include "py/runtime.h"
|
||||
#include "shared-bindings/audiomp3/MP3File.h"
|
||||
#include "shared-bindings/audiomp3/MP3Decoder.h"
|
||||
#include "shared-bindings/util.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
//| .. currentmodule:: audiomp3
|
||||
//|
|
||||
//| :class:`MP3` -- Load a mp3 file for audio playback
|
||||
//| :class:`MP3Decoder` -- Load a mp3 file for audio playback
|
||||
//| ========================================================
|
||||
//|
|
||||
//| A .mp3 file prepped for audio playback. Only mono and stereo files are supported. Samples must
|
||||
//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating
|
||||
//| an internal buffer.
|
||||
//| An object that decodes MP3 files for playback on an audio device.
|
||||
//|
|
||||
//| .. class:: MP3(file[, buffer])
|
||||
//|
|
||||
@ -63,7 +61,7 @@
|
||||
//| speaker_enable.switch_to_output(value=True)
|
||||
//|
|
||||
//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb")
|
||||
//| mp3 = audiomp3.MP3File(data)
|
||||
//| mp3 = audiomp3.MP3Decoder(data)
|
||||
//| a = audioio.AudioOut(board.A0)
|
||||
//|
|
||||
//| print("playing")
|
||||
@ -270,7 +268,7 @@ STATIC const audiosample_p_t audiomp3_mp3file_proto = {
|
||||
|
||||
const mp_obj_type_t audiomp3_mp3file_type = {
|
||||
{ &mp_type_type },
|
||||
.name = MP_QSTR_MP3File,
|
||||
.name = MP_QSTR_MP3Decoder,
|
||||
.make_new = audiomp3_mp3file_make_new,
|
||||
.locals_dict = (mp_obj_dict_t*)&audiomp3_mp3file_locals_dict,
|
||||
.protocol = &audiomp3_mp3file_proto,
|
@ -31,7 +31,7 @@
|
||||
#include "py/obj.h"
|
||||
#include "extmod/vfs_fat.h"
|
||||
|
||||
#include "shared-module/audiomp3/MP3File.h"
|
||||
#include "shared-module/audiomp3/MP3Decoder.h"
|
||||
|
||||
extern const mp_obj_type_t audiomp3_mp3file_type;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "py/obj.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
#include "shared-bindings/audiomp3/MP3File.h"
|
||||
#include "shared-bindings/audiomp3/MP3Decoder.h"
|
||||
|
||||
//| :mod:`audiomp3` --- Support for MP3-compressed audio files
|
||||
//| ==========================================================
|
||||
@ -44,12 +44,12 @@
|
||||
//| .. toctree::
|
||||
//| :maxdepth: 3
|
||||
//|
|
||||
//| MP3File
|
||||
//| MP3Decoder
|
||||
//|
|
||||
|
||||
STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiomp3) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_MP3File), MP_ROM_PTR(&audiomp3_mp3file_type) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_MP3Decoder), MP_ROM_PTR(&audiomp3_mp3file_type) },
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(audiomp3_module_globals, audiomp3_module_globals_table);
|
||||
|
Loading…
Reference in New Issue
Block a user