Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

MP3_Player_Ultibo

MP3 Player with Ultibo and libmad

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

MP3 Player with Ultibo

Using libmad to decode the mp3 file.

Usage

Based on the 20-PWMSound example (Pascal).

  • Folder RPi3 (Raspberry Pi 3A/3B/Zero2).
  • Folder RPi4 (Raspberry Pi 4B/400).
  • You must compile the Ultibo project (Pascal).
  • Copy the test.mp3 file to the micro SD.

Note: You can use another mp3 file, but be sure to change the name within the program. The mp3 file has been downloaded from this site.

The included mad.pas file is only needed until the fpc package included with Ultibo is updated. It is recommended to work with the develop branch of Ultibo, as it includes the libmad static library.

Program

  • With the test.mp3 file, it reads it, decodes it, and obtains relevant information.
  • Gets the duration of the song in hh:mm:ss.
  • It is then played back via PWM with the output of the jack.

On screen displays:

pascal
The file size of test.mp3 is: 2105160 bytes
Read MP3 File OK

Decoding the mp3 file..

Duration: 00:02:11
Bitrate: 128000 bps
Number channels: 2
Sample Rate: 44100 hz

Additional information