Android mediaplayer. Create () Error Summary

Source: Internet
Author: User

Play the music on the specified SD card. Use mmediaplayer. setdatasource ("\ sdcard \") sets the path of the file to be played, and then calls start (), stop (), and pause () to start, stop and pause playback.

However, if the app comes with its own music (such as the sound effects in the game), it is not the music in the sdcard. Normally, there will be 'res \ AW \' under the app directory, it is very easy to set the playing path of the music. You only need to change the setdatasource () method to a mediaplayer object created by the create method to specify the resource index, that is, mmediaplayer = mediaplayer.Create(Context
Context, int resid ).

However, there is a problem here. It should be noted that the size of resid is smaller than 1 MB. If it is large, an error will occur ..... I have been entangled in this issue for a long time. I have checked a lot of information and posted it for your reference ....

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.