@@ -46,8 +46,9 @@ static bool stream_readable(void *stream) {
46
46
return ret != 0 ;
47
47
}
48
48
49
- // (near copy of mp_stream_posix_read, but with changes)
50
- // (circuitpy doesn't enable posix stream routines anyway)
49
+ // This is a near copy of mp_stream_posix_read, but avoiding use of global
50
+ // errno value & with added prints for debugging purposes. (circuitpython doesn't
51
+ // enable mp_stream_posix_read anyway)
51
52
static mp_int_t stream_read (void * stream , void * buf , size_t len ) {
52
53
int errcode ;
53
54
mp_obj_base_t * o = MP_OBJ_TO_PTR (stream );
@@ -69,8 +70,8 @@ static mp_int_t stream_read(void *stream, void *buf, size_t len) {
69
70
}
70
71
}
71
72
72
- // ( near copy of mp_stream_posix_lseek, but with changes)
73
- // (circuitpy doesn't enable posix stream routines anyway)
73
+ // This is a near copy of mp_stream_posix_lseek, but avoiding use of global
74
+ // errno value (circuitpython doesn't enable posix stream routines anyway)
74
75
static off_t stream_lseek (void * stream , off_t offset , int whence ) {
75
76
int errcode ;
76
77
const mp_obj_base_t * o = stream ;
@@ -267,7 +268,7 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self,
267
268
mp_obj_t stream ,
268
269
uint8_t * buffer ,
269
270
size_t buffer_size ) {
270
- // XXX Adafruit_MP3 uses a 2kB input buffer and two 4kB output pcm_buffer.
271
+ // Note: Adafruit_MP3 uses a 2kB input buffer and two 4kB output pcm_buffer.
271
272
// for a whopping total of 10kB pcm_buffer (+mp3 decoder state and frame buffer)
272
273
// At 44kHz, that's 23ms of output audio data.
273
274
//
0 commit comments