If you put mp3 file in Android soundpool and play it, it will be executed, but if you put wav file, it will not play. crying

Asked 2 years ago, Updated 2 years ago, 28 views

If you put mp3 file in Android soundpool and play it, it will be executed, but if you put wav file, it will not play. Is there a solution??

Looking at the error window, The sample not ready appears.

android java

2022-09-22 13:20

1 Answers

Error caused by playing the sound source before the Wav file is loaded into memory. Use the setOnLoadCompleteListener(SoundPool.OnLoadCompleteListener) function in SoundPool to play the sound source when the load is complete.

Please refer to the blog post below for the relevant sample code and information.


2022-09-22 13:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.