Android music play-mediaplayer, unable to create media player

Source: Internet
Author: User

2013-06-23

Lead:Some problems are very tangled. The first time I wrote software with sound, I had various problems!


Body: I found the method of using mediaplayer on the Internet and used it in the program. I found that there was always a problem and an error was reported during setdatasource. The error code is as follows:

06-23 18:07:41.455: E/MediaPlayer(16244): Unable to to create media player06-23 18:07:41.460: W/System.err(16244): java.io.IOException: setDataSourceFD failed.: status=0x8000000006-23 18:07:41.465: W/System.err(16244): at android.media.MediaPlayer.setDataSource(Native Method)06-23 18:07:41.465: W/System.err(16244): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1186)06-23 18:07:41.465: W/System.err(16244): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1157)06-23 18:07:41.465: W/System.err(16244): at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1103)06-23 18:07:41.465: W/System.err(16244): at akai.android.seavoice.MainActivity$1$1.run(MainActivity.java:270)

In fact, there is no problem with the Code. My audio is downloaded from the Internet, and there are some problems in the download process, which leads to incorrect audio files.

Solution: Use File Management to open your audio file and check whether it can be opened. If this problem occurs, it is a file problem, not a code problem.

Above!

Related Article

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.