Sin descripción

zhangtec ff666db854 Merge pull request #5 from zenghaicang/master hace 1 año
inc e5837c7ada fix warnings hace 3 años
src b3fdf94f65 使用RT_VER_NUM宏判断内核版本,兼容rt-thread5.0以上版本,rt_mq_recv返回值的问题 hace 1 año
LICENSE e5837c7ada fix warnings hace 3 años
README.md e5837c7ada fix warnings hace 3 años
README_ZH.md e5837c7ada fix warnings hace 3 años
SConscript e5837c7ada fix warnings hace 3 años

README.md

mp3player

中文页 | English

1. Introduction

mp3player is a simple mp3 format music player that provides functions for playing mp3 files,decode id3v1,id3v2 tag, supporting functions such as play, stop, pause, resume, seek,and volume adjustment.

1.1. File structure

Folder Description
src Core source code, which mainly implements mp3 playback and tag decode, and export Finsh command line
inc Header file directory

1.2 License

The mp3player package complies with the Apache 2.0 license, see the LICENSE file for details.

1.3 Dependency

  • RT-Thread 4.0+
  • RT-Thread Audio driver framework
  • optparse command line parameter parsing package
  • helix mp3 decoder

1.4 Configuration Macro Description

 --- mp3 player: Minimal music player for mp3 file play.   
 [*]   Enable mp3 player                                   
 (sound0) The play device name                                       
 (2048) mp3 input buffer size                                   
 (4608) mp3 output buffer size   
 (50)  mp3 player default volume                                 
       Version (v1.0.0)  --->  

The play device name: Specify the sound card device used for playback, default sound0

2. Use

Common functions of mp3player have been exported to Finsh command line for developers to test and use.

The functions provided by the play command are as follows

msh />mp3play -help
usage: mp3play [option] [target] ...

usage options:
  -h,     --help                     Print defined help message.
  -s URI, --start=URI                Play mp3 music with URI(local files).
  -t,     --stop                     Stop playing music.
  -p,     --pause                    Pause the music.
  -r,     --resume                   Resume the music.
  -v lvl, --volume=lvl               Change the volume(0~99).
  -d,     --dump                     Dump play relevant information.
  -j      --jump                     Jump to seconds that given.

2.1 Play function

  • Start playing

    msh />mp3play -s bryan_adams_-_here_i_am.mp3
    [I/mp3 player]: play start, uri=bryan_adams_-_here_i_am.mp3
    msh />------------MP3 INFO------------
    Title:Here I Am
    Artist:Bryan Adams
    Year:2002
    Comment:Spirit: Stallion Of The Cimarr
    Genre:Blues
    Length:04:45
    Bitrate:320 kbit/s
    Frequency:44100 Hz
    --------------------------------
    
  • seek play

    jump to 100 seconds
    msh />mp3play -j 100
    
  • Stop play

    msh />mp3play -t
    [I/mp3 player] play end
    
  • Pause playback

    msh />mp3play -p
    
  • Resume playback

    msh />mp3play -r
    
  • Set volume

    msh />mp3play -v 50
    
    msh />mp3play -d
    
    - dump info
    mp3_player status:
    uri     - bryan_adams_-_here_i_am.mp3
    status  - PLAYING
    volume  - 10
    00:03 / 04:45
    ------------MP3 INFO------------
    Title:Here I Am
    Artist:Bryan Adams
    Year:2002
    Comment:Spirit: Stallion Of The Cimarr
    Genre:Blues
    Length:04:45
    Bitrate:320 kbit/s
    Frequency:44100 Hz
    --------------------------------
    

3. Matters needing attention

4. Contact