ゲームのサウンドを読み込む際に問題が発生しています。または、むしろ、いくつかの音。それはR.raw.success
とR.raw.fail
の読み込みに問題はないようです。いずれの音符も読み込まれません。以下は私のロードコードです:SoundPoolのサウンドがアンドロイドに読み込まれない
SoundPool soundPool = new SoundPool(20, AudioManager.STREAM_MUSIC, 1);
int[] sounds = new int[6];
sounds[0] = soundPool.load(getApplicationContext(), R.raw.note_c, 1);
sounds[1] = soundPool.load(getApplicationContext(), R.raw.note_d, 1);
sounds[2] = soundPool.load(getApplicationContext(), R.raw.note_e, 1);
sounds[3] = soundPool.load(getApplicationContext(), R.raw.note_g, 1);
sounds[4] = soundPool.load(getApplicationContext(), R.raw.note_a, 1);
sounds[5] = soundPool.load(getApplicationContext(), R.raw.note_ctwo, 1);
success_sound = soundPool.load(getApplicationContext(), R.raw.success, 1);
fail_sound = soundPool.load(getApplicationContext(), R.raw.fail, 1);
どのファイルをロードするかは関係ありません。 fail
とsuccess
だけが問題なく読み込まれます。サウンドはうまくいっていましたが、私が最後に行ったパッチでは、サウンドが読み込まれなくなりました。ファイルの名前を変更してもこれが解決されませんでした。
すでに、あらゆる形でエラーを「グーグルグーグル」していますが、無駄です。私はLogCatで次の出力を得る:(2つの最後の行は、成功していると失敗が問題なく読み込みが鳴ります。)
com.example.application E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
com.example.application E/NdkMediaExtractor: sf error code: -1010
com.example.application E/SoundPool: Unable to load sample
com.example.application E/NdkMediaExtractor: sf error code: -1010
com.example.application E/SoundPool: Unable to load sample
com.example.application E/NdkMediaExtractor: sf error code: -1010
com.example.application E/SoundPool: Unable to load sample
com.example.application E/NdkMediaExtractor: sf error code: -1010
com.example.application E/SoundPool: Unable to load sample
com.example.application E/NdkMediaExtractor: sf error code: -1010
com.example.application E/SoundPool: Unable to load sample
com.example.application E/NdkMediaExtractor: sf error code: -1010
com.example.application E/SoundPool: Unable to load sample
com.example.application I/OMXClient: Using client-side OMX mux.
com.example.application I/OMXClient: Using client-side OMX mux.
音を再生するを想定しあるとき、私は次のような出力が得られます。
問題は、あなたの資産(音声ファイル)であるかもしれない W/SoundPool: sample 1 not READY