Voice in android game development

Source: Internet
Author: User

In game development, I learned from materials and books that two formats of playing audio can be used in our game development: mediaplayer and soundpool!

PS: Of course, there is another jetplayer, but the format of the file to be played is quite troublesome, so I will not explain it here. If you are interested, you can study it on your own;

Run:

Mediaplayer and: soundpool class! What are their advantages and disadvantages? Or, which one is better for game development?

The answer is: both are required !!! After analyzing the pros and cons and their respective purposes, I will give you a detailed explanation when you are familiar with each playing mode!

Below is still the firstCode(Read the code first, and then I will explain the advantages and disadvantages of the two playback formats, their respective purposes, and several notes in the Code !)

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
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.