TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136734 times)
  2. FAT32 Library (69950 times)
  3. Network Ethernet Library (55941 times)
  4. USB Device Library (46266 times)
  5. Network WiFi Library (41886 times)
  6. FT800 Library (41170 times)
  7. GSM click (28983 times)
  8. PID Library (26413 times)
  9. mikroSDK (26360 times)
  10. microSD click (25376 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

MP3 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.4

mikroSDK Library: 2.0.0.0

Category: MP3

Downloaded: 49 times

Not followed.

License: MIT license  

MP3 Click is an accessory board in mikroBus™ form factor. It includes a stereo MP3 decoder chip VS1053 which can decode multiple formats (Ogg vorbis, MP3, MP1, MP2, MPEG4, WMA, FLAC, WAV, MIDI).

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "MP3 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "MP3 click" changes.

Do you want to report abuse regarding "MP3 click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


MP3 click

MP3 Click is an accessory board in mikroBus™ form factor. It includes a stereo MP3 decoder chip VS1053 which can decode multiple formats (Ogg vorbis, MP3, MP1, MP2, MPEG4, WMA, FLAC, WAV, MIDI).

mp3_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Feb 2020.
  • Type : SPI type

Software Support

We provide a library for the Mp3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Mp3 Click driver.

Standard key functions :

  • mp3_cfg_setup Config Object Initialization function.

    void mp3_cfg_setup ( mp3_cfg_t *cfg ); 
  • mp3_init Initialization function.

    err_t mp3_init ( mp3_t *ctx, mp3_cfg_t *cfg );

Example key functions :

  • mp3_cmd_write Function writes one byte (command) to MP3

    void mp3_cmd_write( mp3_t *ctx, uint8_t address, uint16_t input );
  • mp3_data_write Function writes one byte ( data ) to MP3

    err_t mp3_data_write( mp3_t *ctx, uint8_t input );
  • mp3_data_write_32 Function Write 32 bytes ( data ) to MP3

    err_t mp3_data_write_32( mp3_t *ctx, uint8_t *input32 );

Example Description

This app demonstrates the use of MP3 click by playing the specified sound from the mp3_resources.h file.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the default click configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;
    mp3_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    mp3_cfg_setup( &cfg );
    MP3_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    mp3_init( &mp3, &cfg );

    mp3_reset( &mp3 );

    mp3_cmd_write( &mp3, MP3_MODE_ADDR, 0x0800 );
    mp3_cmd_write( &mp3, MP3_BASS_ADDR, 0x7A00 );
    mp3_cmd_write( &mp3, MP3_CLOCKF_ADDR, 0x2000 );

    // MP3 set volume, maximum volume is 0x00 and total silence is 0xFE.
    mp3_set_volume( &mp3, 0x2F, 0x2F );
    Delay_ms ( 1000 );

    log_info( &logger, " Application Task " );
}

Application Task

Playing the specified sound form the mp3_resources.h file.


void application_task ( void )
{
    uint32_t file_size = sizeof ( gandalf_sax_mp3_compressed );
    uint32_t file_pos = 0;
    uint8_t data_buf[ 32 ] = { 0 };

    log_printf( &logger, " Playing audio..." );
    for ( file_pos = 0; ( file_pos + 32 ) <= file_size; file_pos += 32 )
    {
        memcpy ( data_buf, &gandalf_sax_mp3_compressed[ file_pos ], 32 );
        while ( MP3_OK != mp3_data_write_32( &mp3, data_buf ) );
    }

    for ( ; file_pos < file_size; file_pos++ )
    {
        while ( MP3_OK != mp3_data_write( &mp3, gandalf_sax_mp3_compressed[ file_pos ] ) );
    }
    log_printf( &logger, "Done\r\n\n" );
}  

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Mp3

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

SPI Isolator 3 click

0

SPI Isolator 3 Click is a compact add-on board that contains a digital isolator optimized for a serial peripheral interface. This board features the MAX14483, a 6-channel 3.75kVRMS digital galvanic isolator with a very low propagation delay on the SDI, SDO, and SCLK channels from Maxim Integrated. Besides a second enable control input, which allows MAX14483 to isolate multiple SPI devices, and an auxiliary channel available for passing timing or control signals from the master side to the slave side, the MAX14483 also possesses power monitors provided for both power domains to signal if the opposite side of the isolator is ready for operation.

[Learn More]

UVC click

0

UVC Click is an ultraviolet sensing board which complements UVC Light Click for a ultimate ultraviolet solution. The board is based on GUVC-T21GH ultraviolet sensor from GenUV, capable of measuring UVC spectrum in the range of 220nm up to 280nm and light intensity from 0mW/cm² up to 9.3mW/cm². With high sensitivity and good solar blindness, it can be a perfect solution for monitoring sterilization lamps used in ultraviolet germicidal irradiation (UVGI), a disinfection method that is becoming an essential tool in the battle against viruses and bacteria. UVC Click has two ways of reading UV sensor output, direct analog output value and digital output thanks to MCP3221 ADC converter.

[Learn More]

6DOF IMU click

0

6DOF IMU click carries ST’s LSM6DS33TR 6-axis inertial measurement unit comprising a 3-axis gyroscope and a 3-axis accelerometer. The chip is a highly accurate 6 DOF inertial measurement unit with long-term stable operation over a wide range of temperatures.

[Learn More]