Ich habe Probleme beim Laden von Sounds für mein Spiel. Oder vielmehr einige der Geräusche. Es scheint kein Problem zu haben, R.raw.success
und R.raw.fail
zu laden. aber keine der Noten wird geladen. Der folgende Code ist mein Ladecode:Sounds in SoundPool lädt nicht in Android
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);
Es scheint nicht wichtig zu sein, in welcher Reihenfolge ich die Dateien lade. Nur fail
und success
wird ohne Probleme geladen. Der Sound funktionierte eine ganze Weile, aber während des letzten Patches, an dem ich gerade arbeite, hörten die Sounds auf zu laden. Das Ändern des Namens der Dateien hat das auch nicht gelöst.
Haben bereits ausgiebig "googeln" die Fehler in allen Formen und Formen, vergeblich versucht. Ich die folgende Ausgabe in LogCat erhalten: (Die letzten beiden Zeilen sind der Erfolg und scheitern klingt Laden ohne Problem.)
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.
Wenn der Ton gespielt werden soll, bekomme ich die folgende Ausgabe:
W/SoundPool: sample 1 not READY