# Read MP3 file from USB flashdrive and play it

**URL:** <https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185>\
**Category:** micro:bit\
**Created:** [September 1, 2022, 8:26pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185 "2022-09-01T20:26:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MK97-2007](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mk97-2007/32/1603_2.png) [@MK97-2007](https://forum.makecode.com/u/MK97-2007)\
**Post date:** [September 1, 2022, 8:26pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/1 "2022-09-01T20:26:57Z")

</div>

Yeahh, the title explains everything….

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [September 2, 2022, 4:27pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/2 "2022-09-02T16:27:29Z")

</div>

That’s a pretty complex task. I don’t think there are any easy ways for the micro:bit to do either, read from a flash drive or play an mp3. It may be better to look at a more sophisticated device, like a RaspberryPi. Pis already support for things like reading from drives and playing mp3s.

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [September 2, 2022, 9:18pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/3 "2022-09-02T21:18:07Z")

</div>

There are C++ libraries for decoding MP3s, so not that difficult, although you would obviously have to use C++.

USB host is difficult, you would need external hardware. Something like a Teensy 3.6 or a Teensy 4.1 has hardware and software support for reading files off a flash drive. (Again, in C++)

What is easier, is interfacing a SD card in SPI mode - that requires less hardware and software support is easy, but I don’t know if any MakeCode extensions to read that. There is support for that in C++ (Arduino) and MicroPython.

So the easiest way would be to switch to Arduino and wire up a SD card and speaker amp, but external hardware is needed.

---

<div class="post-metadata">

**Author:** ![MK97-2007](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mk97-2007/32/1603_2.png) [@MK97-2007](https://forum.makecode.com/u/MK97-2007)\
**Post date:** [September 6, 2022, 4:07pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/4 "2022-09-06T16:07:27Z")

</div>

What about tje Melwbit? Buildt in sd?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [September 6, 2022, 5:01pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/5 "2022-09-06T17:01:02Z")

</div>

It appears the Meowbit has all the hardware necessary to read files off an SD card, with the inclusion of a SD card slot. I haven’t looked too much into it, but it shouldn’t be much work to get Arduino running on it. You probably will still need the speaker amp because I don’t think you will get very good sound quality with a buzzer.

---

<div class="post-metadata">

**Author:** ![MK97-2007](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mk97-2007/32/1603_2.png) [@MK97-2007](https://forum.makecode.com/u/MK97-2007)\
**Post date:** [September 7, 2022, 6:02pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/6 "2022-09-07T18:02:45Z")

</div>

I have a 1.5 amp speaker. The only thing I need is read from the sdcard and decode the mp3

---

<div class="post-metadata">

**Author:** ![IAmMyGuy21th](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/iammyguy21th/32/16978_2.png) [@IAmMyGuy21th](https://forum.makecode.com/u/IAmMyGuy21th)\
**Post date:** [April 8, 2025, 12:49pm UTC](https://forum.makecode.com/t/read-mp3-file-from-usb-flashdrive-and-play-it/15185/7 "2025-04-08T12:49:15Z")

</div>

To do this on the microbit you want to put it on the flash storage then play it. Only for micro:bit v2 I think. Maybe use the add file option in [python.microbit.org](http://python.microbit.org)? Make a scratch project or something to convert the whole mp3 to text then put it as a variable in the project, like music = “converted mp3 here” or music = [converted,mp3,here]
