I initialize audio
SoundPool sp; int error_sound; int del_sound; int level_complete_sound; int level_complete_123; // Аудио sp = new SoundPool(10, AudioManager.STREAM_MUSIC, 0); error_sound = sp.load(this, R.raw.error_sound, 1); del_sound = sp.load(this, R.raw.del_sound, 1); level_complete_sound = sp.load(this, R.raw.level_complete_sound, 1); level_complete_123 = sp.load(this, R.raw.level_complete_123, 1);
and then repeatedly use one other sound when pressed
sp.play(error_sound, 1, 1, 0, 0, 1);
Everything works, but occasionally, especially when restarting the activity, the sounds work through one, and an error occurs
E/AudioMixer: AudioMixer::getTrackName out of available tracks E/AudioFlinger: no more track names available E/AudioFlinger: createTrack_l() initCheck failed -12; no control block? E/AudioTrack: AudioFlinger could not create track, status: -12 E/SoundPool: Error creating AudioTrack
Audio files of small size and duration, about 3-6 seconds. The error itself, as I understand it, indicates that the track cannot be loaded due to lack of memory. But I do not understand what exactly I am doing wrong. Tell me please.