Skip to content

Commit dc72971

Browse files
committed
audiomp3: rename to MP3Decoder
1 parent bd8650d commit dc72971

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

shared-bindings/audiomp3/MP3File.c renamed to shared-bindings/audiomp3/MP3Decoder.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,16 @@
3030
#include "lib/utils/context_manager_helpers.h"
3131
#include "py/objproperty.h"
3232
#include "py/runtime.h"
33-
#include "shared-bindings/audiomp3/MP3File.h"
33+
#include "shared-bindings/audiomp3/MP3Decoder.h"
3434
#include "shared-bindings/util.h"
3535
#include "supervisor/shared/translate.h"
3636

3737
//| .. currentmodule:: audiomp3
3838
//|
39-
//| :class:`MP3` -- Load a mp3 file for audio playback
39+
//| :class:`MP3Decoder` -- Load a mp3 file for audio playback
4040
//| ========================================================
4141
//|
42-
//| A .mp3 file prepped for audio playback. Only mono and stereo files are supported. Samples must
43-
//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating
44-
//| an internal buffer.
42+
//| An object that decodes MP3 files for playback on an audio device.
4543
//|
4644
//| .. class:: MP3(file[, buffer])
4745
//|
@@ -63,7 +61,7 @@
6361
//| speaker_enable.switch_to_output(value=True)
6462
//|
6563
//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb")
66-
//| mp3 = audiomp3.MP3File(data)
64+
//| mp3 = audiomp3.MP3Decoder(data)
6765
//| a = audioio.AudioOut(board.A0)
6866
//|
6967
//| print("playing")
@@ -270,7 +268,7 @@ STATIC const audiosample_p_t audiomp3_mp3file_proto = {
270268

271269
const mp_obj_type_t audiomp3_mp3file_type = {
272270
{ &mp_type_type },
273-
.name = MP_QSTR_MP3File,
271+
.name = MP_QSTR_MP3Decoder,
274272
.make_new = audiomp3_mp3file_make_new,
275273
.locals_dict = (mp_obj_dict_t*)&audiomp3_mp3file_locals_dict,
276274
.protocol = &audiomp3_mp3file_proto,

shared-bindings/audiomp3/MP3File.h renamed to shared-bindings/audiomp3/MP3Decoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "py/obj.h"
3232
#include "extmod/vfs_fat.h"
3333

34-
#include "shared-module/audiomp3/MP3File.h"
34+
#include "shared-module/audiomp3/MP3Decoder.h"
3535

3636
extern const mp_obj_type_t audiomp3_mp3file_type;
3737

shared-bindings/audiomp3/__init__.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "py/obj.h"
3030
#include "py/runtime.h"
3131

32-
#include "shared-bindings/audiomp3/MP3File.h"
32+
#include "shared-bindings/audiomp3/MP3Decoder.h"
3333

3434
//| :mod:`audiomp3` --- Support for MP3-compressed audio files
3535
//| ==========================================================
@@ -44,12 +44,12 @@
4444
//| .. toctree::
4545
//| :maxdepth: 3
4646
//|
47-
//| MP3File
47+
//| MP3Decoder
4848
//|
4949

5050
STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = {
5151
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiomp3) },
52-
{ MP_ROM_QSTR(MP_QSTR_MP3File), MP_ROM_PTR(&audiomp3_mp3file_type) },
52+
{ MP_ROM_QSTR(MP_QSTR_MP3Decoder), MP_ROM_PTR(&audiomp3_mp3file_type) },
5353
};
5454

5555
STATIC MP_DEFINE_CONST_DICT(audiomp3_module_globals, audiomp3_module_globals_table);

0 commit comments

Comments
 (0)