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 |