realizes the function of the MP3 player

Source: Internet
Author: User

realizes the function of the MP3 player



Simple implementation of the function of the MP3 player, meet the comparison is not good, speak


Check it out.

Main functions:

1. Display the file list, mainly referring to a predecessor's code, thanks.

2. You can implement playback start, pause.

3. File filtering


Java Code Collection Code

Return f.isdirectory () | | F.getname (). EndsWith


(". mp3");



In fact, there are a lot of things to achieve:

1. Progress bar.

2. Press the key to enter the next song.

3. Beautify yourself.


==============================

Main code:


Call the MP3 file and play it


Java Code Collection Code

MediaPlayer MP = new MediaPlayer ();

try {

Mp.setdatasource (Mp3file.getpath ());

Mp.setaudiostreamtype


(Audiosystem.stream_music);

Mp.prepare ();

Mp.start ();

} catch (IOException e) {

}



What's the rest of it?


More good stuff in here. Programmers must SEE: http://itlanbao.com/preview.aspx#1,0


realizes the function of the MP3 player

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.