Mp3 audio in the Android Assets folder fails to play from a signed and zip-aligned APK

前端 未结 3 933
庸人自扰
庸人自扰 2021-01-14 20:13

I am loading mp3 files to play in an Android game based on AndEngine. When I package my game as an APK, mp3 audio in the assets folder throws the error \"can not be opened a

3条回答
  •  青春惊慌失措
    2021-01-14 20:13

    You could put the audio-files in the "RAW" folder and play them via:

    mPlayer2= MediaPlayer.create(this, R.raw.MUSICTAG);
    mPlayer2.start();
    

    This way, there should be no problems with compression.

提交回复
热议问题