summaryrefslogtreecommitdiff
path: root/shared-bindings/audiomp3
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-01-06 07:51:41 -0600
committerJeff Epler <jepler@gmail.com>2020-01-06 07:51:41 -0600
commitdc729718eb2980e3b92a54e4cc60c7d6b0720e8a (patch)
tree1415e35743c653a66ed494b3f4a4e9fcfaec5064 /shared-bindings/audiomp3
parentbd8650d35be493bfbfef34976784d1d614b09ed1 (diff)
audiomp3: rename to MP3Decoder
Diffstat (limited to 'shared-bindings/audiomp3')
-rw-r--r--shared-bindings/audiomp3/MP3Decoder.c (renamed from shared-bindings/audiomp3/MP3File.c)12
-rw-r--r--shared-bindings/audiomp3/MP3Decoder.h (renamed from shared-bindings/audiomp3/MP3File.h)2
-rw-r--r--shared-bindings/audiomp3/__init__.c6
3 files changed, 9 insertions, 11 deletions
diff --git a/shared-bindings/audiomp3/MP3File.c b/shared-bindings/audiomp3/MP3Decoder.c
index a02e42364..a93206e15 100644
--- a/shared-bindings/audiomp3/MP3File.c
+++ b/shared-bindings/audiomp3/MP3Decoder.c
@@ -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,
diff --git a/shared-bindings/audiomp3/MP3File.h b/shared-bindings/audiomp3/MP3Decoder.h
index e6787cb8b..36d525e93 100644
--- a/shared-bindings/audiomp3/MP3File.h
+++ b/shared-bindings/audiomp3/MP3Decoder.h
@@ -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;
diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c
index 06f852ff1..fb2187669 100644
--- a/shared-bindings/audiomp3/__init__.c
+++ b/shared-bindings/audiomp3/__init__.c
@@ -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);