Android Studio SoundPool not playing sounds sporadically

岁酱吖の 提交于 2019-12-25 03:11:02

问题


I am having some issues with getting my soundboard app to function correctly. I have switched to using this method over using MediaPlayer as soundpool was designed for this kind of app. I am running into issues with this app however, whereby when I click on a button a sound will play sometimes, but not all the time. It feels random.

I have an OnLoadCompleteListener which is firing a status of "0" which according to the SoundPool class documentation means success. This does not seem to be the case though. I have created all of the correct OnClick attributes to the buttons in the app. I have about 40+ various sounds in .MP3 format and they are all on average between 50 to 100kbs in capacity.

I have loaded a Splash Screen in front of this app too which gives it more time for the sounds to load in the background (i'm assuming). I have tried this on multiple emulators and live devices. The sounds seem to play more often than not on Nexus devices but not on any of the SamSung Galaxies and OnePlus devices that I have tested on so far.

It feels like I am very close to getting this working so any simple pointers would help me out a lot. Thanks again. Here is what I have so far:

package g.convery.cat_sounds;

import android.app.Activity;
import android.media.AudioManager;
import android.media.SoundPool;
import android.media.SoundPool.OnLoadCompleteListener;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.media.AudioAttributes;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TabHost;
import android.widget.Toast;
import android.media.AudioAttributes;


import com.google.android.gms.ads.MobileAds;
import com.google.android.gms.ads.InterstitialAd;
import com.google.android.gms.ads.AdRequest;



public class MainActivity extends AppCompatActivity {

    public static final String TAG = "Status";
    public static final String TAG1 = "Destroy";

    //Sounds
    private int meow1, meow2, meow3, meow4, meow5, meow6, meow7, meow8, meow9, meow10, meow11, meow12, purr1,
            purr2, purr3, purr4, purr5, purr6, purr7, purr8, purr9, purr10, purr11, purr12, purr13, purr14, purr15, purr16, purr17, purr18, catcrazy1,
            catcrazy2, catcrazy3, catcrazy4, catcrazy5, catcrazy6, catcrazy7, catcrazy8, catcrazy9, catcrazy10, catcrazy11, catcrazy12, catcrazy13, catcrazy14,
            catcrazy15, catcrazy16, catcrazy17, catcrazy18, catcrazy19, catcrazy20, catcrazy21;

    //Load Soundpool and tabHost

    private SoundPool soundPool;
    boolean loaded = false;
    TabHost tabHost;
    public InterstitialAd mInterstitialAd;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        tabHost = findViewById(R.id.tabHost);
        tabHost.setup();

        //Tab1
        TabHost.TabSpec spec = tabHost.newTabSpec(getResources().getString(R.string.tab_one_title));
        spec.setContent(R.id.tab1);
        spec.setIndicator(getResources().getString(R.string.tab_one_title));
        tabHost.addTab(spec);

        //Tab 2
        spec = tabHost.newTabSpec(getResources().getString(R.string.tab_two_title));
        spec.setContent(R.id.tab2);
        spec.setIndicator(getResources().getString(R.string.tab_two_title));
        tabHost.addTab(spec);

        //Tab 3
        spec = tabHost.newTabSpec(getResources().getString(R.string.tab_three_title));
        spec.setContent(R.id.tab3);
        spec.setIndicator(getResources().getString(R.string.tab_three_title));
        tabHost.addTab(spec);

        //Event
        tabHost.setOnTabChangedListener(new AnimationTabListener(this, tabHost));


     //  Ads - not added yet


//        MobileAds.initialize(this, "ca-app-pub-9834454250090170~1138603969");
//        mInterstitialAd = new InterstitialAd(this);
//        mInterstitialAd.setAdUnitId("ca-app-pub-9834454250090170/2106989133");
//        mInterstitialAd.loadAd(new AdRequest.Builder().build());


        // Create SoundPool Builder and regular SoundPool if using an old API


        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            AudioAttributes audioAttributes = new AudioAttributes.Builder()
                    .setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
                    .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
                    .build();
            soundPool = new SoundPool.Builder()
                    .setMaxStreams(10)
                    .setAudioAttributes(audioAttributes)
                    .build();

        } else {
            soundPool = new SoundPool(10, AudioManager.STREAM_MUSIC, 0);
        }


        // Check to see if sounds have been loaded

        soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() {
            @Override
            public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
                loaded = true;
                if(sampleId !=0) {
                    Log.e(TAG, "loading sound tracks (status=" + status + ")");
                }
            }
        });

        //Load sounds to soundPool

        meow1 = soundPool.load(this, R.raw.meow1, 1);
        meow2 = soundPool.load(this, R.raw.meow2, 1);
        meow3 = soundPool.load(this, R.raw.meow3, 1);
        meow4 = soundPool.load(this, R.raw.meow4, 1);
        meow5 = soundPool.load(this, R.raw.meow5, 1);
        meow6 = soundPool.load(this, R.raw.meow6, 1);
        meow7 = soundPool.load(this, R.raw.meow7, 1);
        meow8 = soundPool.load(this, R.raw.meow8, 1);
        meow9 = soundPool.load(this, R.raw.meow9, 1);
        meow10 = soundPool.load(this, R.raw.meow10, 1);
        meow11 = soundPool.load(this, R.raw.meow11, 1);
        meow12 = soundPool.load(this, R.raw.meow12, 1);
        purr1 = soundPool.load(this, R.raw.purr1, 1);
        purr2 = soundPool.load(this, R.raw.purr2, 1);
        purr3 = soundPool.load(this, R.raw.purr3, 1);
        purr4 = soundPool.load(this, R.raw.purr4, 1);
        purr5 = soundPool.load(this, R.raw.purr5, 1);
        purr6 = soundPool.load(this, R.raw.purr6, 1);
        purr7 = soundPool.load(this, R.raw.purr7, 1);
        purr8 = soundPool.load(this, R.raw.purr8, 1);
        purr9 = soundPool.load(this, R.raw.purr9, 1);
        purr10 = soundPool.load(this, R.raw.purr10, 1);
        purr11 = soundPool.load(this, R.raw.purr11, 1);
        purr12 = soundPool.load(this, R.raw.purr12, 1);
        purr13 = soundPool.load(this, R.raw.purr13, 1);
        purr14 = soundPool.load(this, R.raw.purr14, 1);
        purr15 = soundPool.load(this, R.raw.purr15, 1);
        purr16 = soundPool.load(this, R.raw.purr16, 1);
        purr17 = soundPool.load(this, R.raw.purr17, 1);
        purr18 = soundPool.load(this, R.raw.purr18, 1);
        catcrazy1 = soundPool.load(this, R.raw.catcrazy1, 1);
        catcrazy2 = soundPool.load(this, R.raw.catcrazy2, 1);
        catcrazy3 = soundPool.load(this, R.raw.catcrazy3, 1);
        catcrazy4 = soundPool.load(this, R.raw.catcrazy4, 1);
        catcrazy5 = soundPool.load(this, R.raw.catcrazy5, 1);
        catcrazy6 = soundPool.load(this, R.raw.catcrazy6, 1);
        catcrazy7 = soundPool.load(this, R.raw.catcrazy7, 1);
        catcrazy8 = soundPool.load(this, R.raw.catcrazy8, 1);
        catcrazy9 = soundPool.load(this, R.raw.catcrazy9, 1);
        catcrazy10 = soundPool.load(this, R.raw.catcrazy10, 1);
        catcrazy11 = soundPool.load(this, R.raw.catcrazy11, 1);
        catcrazy12 = soundPool.load(this, R.raw.catcrazy12, 1);
        catcrazy13 = soundPool.load(this, R.raw.catcrazy13, 1);
        catcrazy14 = soundPool.load(this, R.raw.catcrazy14, 1);
        catcrazy15 = soundPool.load(this, R.raw.catcrazy15, 1);
        catcrazy16 = soundPool.load(this, R.raw.catcrazy16, 1);
        catcrazy17 = soundPool.load(this, R.raw.catcrazy17, 1);
        catcrazy18 = soundPool.load(this, R.raw.catcrazy18, 1);
        catcrazy19 = soundPool.load(this, R.raw.catcrazy19, 1);
        catcrazy20 = soundPool.load(this, R.raw.catcrazy20, 1);
        catcrazy21 = soundPool.load(this, R.raw.catcrazy21, 1);



    }  // onCreate


     // Play sounds if loaded

        public void playSound (View v){
            switch (v.getId()) {
                case R.id.Meow1:
                    if (loaded){
                    soundPool.play(meow1, 1, 1, 0, 0, 1);
                    Log.d("TAG1", "Button 1 pressed");}
                    soundPool.autoPause();
                    break;
                case R.id.Meow2:
                    if (loaded){
                        soundPool.play(meow2, 1, 1, 0, 0, 1);
                        Log.d("TAG1", "Button 2 pressed");}
                    break;
                case R.id.Meow3:
                    if (loaded){
                    soundPool.play(meow3, 1, 1, 0, 0, 1);
                    Log.d("TAG1", "Button 3 pressed");}
                    soundPool.autoPause();
                    break;
                case R.id.Meow4:
                    if (loaded){
                        soundPool.play(meow3, 1, 1, 0, 0, 1);
                        Log.d("TAG1", "Button 4 pressed");}
                    soundPool.autoPause();
                    break;
                case R.id.Meow5:
                    soundPool.play(meow5, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow6:
                    soundPool.play(meow6, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow7:
                    soundPool.play(meow7, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow8:
                    soundPool.play(meow8, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow9:
                    soundPool.play(meow9, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow10:
                    soundPool.play(meow10, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow11:
                    soundPool.play(meow11, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Meow12:
                    soundPool.play(meow12, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    Log.d("TAG1", "Button 12 pressed");
                    break;
                case R.id.Purr1:
                    soundPool.play(purr1, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr2:
                    soundPool.play(purr2, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr3:
                    soundPool.play(purr3, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr4:
                    soundPool.play(purr4, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr5:
                    soundPool.play(purr5, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr6:
                    soundPool.play(purr6, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr7:
                    soundPool.play(purr7, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr8:
                    soundPool.play(purr8, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr9:
                    soundPool.play(purr9, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr10:
                    soundPool.play(purr10, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr11:
                    soundPool.play(purr11, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr12:
                    soundPool.play(purr12, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr13:
                    soundPool.play(purr13, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr14:
                    soundPool.play(purr14, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr15:
                    soundPool.play(purr15, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr16:
                    soundPool.play(purr16, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr17:
                    soundPool.play(purr17, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.Purr18:
                    soundPool.play(purr18, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy1:
                    soundPool.play(catcrazy1, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy2:
                    soundPool.play(catcrazy2, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy3:
                    soundPool.play(catcrazy3, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy4:
                    soundPool.play(catcrazy4, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy5:
                    soundPool.play(catcrazy5, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy6:
                    soundPool.play(catcrazy6, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy7:
                    soundPool.play(catcrazy7, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy8:
                    soundPool.play(catcrazy8, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy9:
                    soundPool.play(catcrazy9, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy10:
                    soundPool.play(catcrazy10, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy11:
                    soundPool.play(catcrazy11, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy12:
                    soundPool.play(catcrazy12, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy13:
                    soundPool.play(catcrazy13, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy14:
                    soundPool.play(catcrazy14, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy15:
                    soundPool.play(catcrazy15, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy16:
                    soundPool.play(catcrazy16, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy17:
                    soundPool.play(catcrazy17, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy18:
                    soundPool.play(catcrazy18, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy19:
                    soundPool.play(catcrazy19, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy20:
                    soundPool.play(catcrazy20, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;
                case R.id.catCrazy21:
                    soundPool.play(catcrazy21, 1, 1, 0, 0, 1);
                    soundPool.autoPause();
                    break;

            }
        }

        // When sound is complete - Destroy - Never seems to be called

@Override
    protected void onDestroy(){
        super.onDestroy();
        soundPool.release();
        soundPool= null;
    Log.d("TAG1", "Destroyed!!");
}


} // Public Class

回答1:


Okay I reached a character limitation on my previous post and could not comment with the Run Compiler & Logcat - here it is:

   **//                           Run compiler**


06/01 12:45:29: Launching app
$ adb install-multiple -r -t -p g.convery.cat_sounds /Users/Gavin-Convery/Desktop/Downloads/Cat_Sounds/app/build/intermediates/split-apk/debug/slices/slice_3.apk 
Split APKs installed
$ adb shell am start -n "g.convery.cat_sounds/g.convery.cat_sounds.SplashScreen" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 28362 on device emulator-5556
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
I/InstantRun: starting instant run server: is main process
W/art: Verification of void g.convery.cat_sounds.SplashScreen.<init>(java.lang.Object[], com.android.tools.ir.runtime.InstantReloadException) took 155.348ms
W/art: Verification of com.google.android.gms.internal.measurement.zzef com.google.android.gms.internal.measurement.zzii.zzgg() took 178.564ms
V/FA: Collection enabled
      App package, google app id: g.convery.cat_sounds, 1:322457081440:android:00bc065a4ca4860c
I/FA: App measurement is starting up, version: 12451
      To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
        adb shell setprop debug.firebase.analytics.app g.convery.cat_sounds
D/FA: Debug-level message logging enabled
V/FA: Cancelling job. JobID: -1724993946
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
V/FA: onActivityCreated
W/art: Verification of void com.google.android.gms.common.GooglePlayServicesUtilLight.ensurePlayServicesAvailable(android.content.Context, int) took 177.917ms
V/FA: Connecting to remote service
W/art: Verification of com.google.android.gms.common.GoogleSignatureVerifier com.google.android.gms.common.GoogleSignatureVerifier.getInstance(android.content.Context) took 173.217ms
W/art: Verification of void com.google.android.gms.common.GoogleCertificates.zzc() took 128.055ms
I/art: Background sticky concurrent mark sweep GC freed 14348(1467KB) AllocSpace objects, 9(596KB) LOS objects, 47% free, 3MB/6MB, paused 8.797ms total 428.537ms
V/FA: Connection attempt already in progress
D/: HostConnection::get() New Host Connection established 0xa4c12180, tid 28362
I/FA: Tag Manager is not found and thus will not be used
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=SplashScreen, firebase_screen_id(_si)=-4328525201999189748}]
D/: HostConnection::get() New Host Connection established 0xa4c12440, tid 28437
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0x9986d120: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 7178857
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
D/FA: Connected to remote service
I/Choreographer: Skipped 38 frames!  The application may be doing too much work on its main thread.
V/FA: Processing queued up service tasks: 4
V/FA: Recording user engagement, ms: 5537
V/FA: Activity paused, time: 7184388
D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=5537, firebase_screen_class(_sc)=SplashScreen, firebase_screen_id(_si)=-4328525201999189748}]
I/Choreographer: Skipped 45 frames!  The application may be doing too much work on its main thread.
V/FA: onActivityCreated
I/art: Background sticky concurrent mark sweep GC freed 1145(153KB) AllocSpace objects, 11(1180KB) LOS objects, 18% free, 4MB/5MB, paused 8.328ms total 251.180ms
I/art: Background partial concurrent mark sweep GC freed 1371(65KB) AllocSpace objects, 4(560KB) LOS objects, 39% free, 4MB/8MB, paused 7.178ms total 87.908ms
E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
I/Choreographer: Skipped 89 frames!  The application may be doing too much work on its main thread.
I/OMXClient: MuxOMX ctor
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=SplashScreen, firebase_previous_id(_pi)=-4328525201999189748, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-4328525201999189747}]
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
V/FA: Activity resumed, time: 7186430
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
D/TAG1: Button 1 pressed
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
D/TAG1: Button 1 pressed
V/FA: Inactivity, disconnecting from the service
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
D/TAG1: Button 1 pressed
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
D/TAG1: Button 1 pressed
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
E/Status: loading sound tracks (status=0)
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
I/OMXClient: MuxOMX ctor
W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/SoundPool:   sample 20 not READY
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/SoundPool:   sample 23 not READY
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/SoundPool:   sample 26 not READY
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
D/EGL_emulation: eglMakeCurrent: 0x9986d120: ver 3 0 (tinfo 0x9983b470)
W/SoundPool:   sample 33 not READY
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/SoundPool:   sample 36 not READY
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
W/SoundPool:   sample 38 not READY
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)
I/OMXClient: MuxOMX ctor
E/Status: loading sound tracks (status=0)


                    /// .  LogCat

06-01 12:45:36.422 28362-28362/? I/art: Not late-enabling -Xcheck:jni (already on)
06-01 12:45:36.425 28362-28362/? W/art: Unexpected CPU variant for X86 using defaults: x86
06-01 12:45:39.563 28362-28362/g.convery.cat_sounds I/FirebaseInitProvider: FirebaseApp initialization successful
06-01 12:45:39.575 28362-28362/g.convery.cat_sounds I/InstantRun: starting instant run server: is main process
06-01 12:45:39.871 28362-28362/g.convery.cat_sounds W/art: Verification of void g.convery.cat_sounds.SplashScreen.<init>(java.lang.Object[], com.android.tools.ir.runtime.InstantReloadException) took 155.348ms
06-01 12:45:39.900 28362-28413/g.convery.cat_sounds W/art: Verification of com.google.android.gms.internal.measurement.zzef com.google.android.gms.internal.measurement.zzii.zzgg() took 178.564ms
06-01 12:45:40.271 28362-28413/g.convery.cat_sounds I/FA: App measurement is starting up, version: 12451
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
06-01 12:45:40.274 28362-28413/g.convery.cat_sounds I/FA: To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app g.convery.cat_sounds
06-01 12:45:40.444 28362-28362/g.convery.cat_sounds W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-01 12:45:41.222 28362-28413/g.convery.cat_sounds W/art: Verification of void com.google.android.gms.common.GooglePlayServicesUtilLight.ensurePlayServicesAvailable(android.content.Context, int) took 177.917ms
06-01 12:45:41.573 28362-28413/g.convery.cat_sounds W/art: Verification of com.google.android.gms.common.GoogleSignatureVerifier com.google.android.gms.common.GoogleSignatureVerifier.getInstance(android.content.Context) took 173.217ms
06-01 12:45:41.706 28362-28413/g.convery.cat_sounds W/art: Verification of void com.google.android.gms.common.GoogleCertificates.zzc() took 128.055ms
06-01 12:45:41.757 28362-28373/g.convery.cat_sounds I/art: Background sticky concurrent mark sweep GC freed 14348(1467KB) AllocSpace objects, 9(596KB) LOS objects, 47% free, 3MB/6MB, paused 8.797ms total 428.537ms
06-01 12:45:42.000 28362-28413/g.convery.cat_sounds I/FA: Tag Manager is not found and thus will not be used
06-01 12:45:42.354 28362-28437/g.convery.cat_sounds I/OpenGLRenderer: Initialized EGL, version 1.4
06-01 12:45:42.354 28362-28437/g.convery.cat_sounds W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
06-01 12:45:42.404 28362-28437/g.convery.cat_sounds E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
06-01 12:45:42.405 28362-28437/g.convery.cat_sounds E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
06-01 12:45:43.098 28362-28362/g.convery.cat_sounds I/Choreographer: Skipped 38 frames!  The application may be doing too much work on its main thread.
06-01 12:45:47.840 28362-28362/g.convery.cat_sounds I/Choreographer: Skipped 45 frames!  The application may be doing too much work on its main thread.
06-01 12:45:48.503 28362-28373/g.convery.cat_sounds I/art: Background sticky concurrent mark sweep GC freed 1145(153KB) AllocSpace objects, 11(1180KB) LOS objects, 18% free, 4MB/5MB, paused 8.328ms total 251.180ms
06-01 12:45:48.698 28362-28373/g.convery.cat_sounds I/art: Background partial concurrent mark sweep GC freed 1371(65KB) AllocSpace objects, 4(560KB) LOS objects, 39% free, 4MB/8MB, paused 7.178ms total 87.908ms
06-01 12:45:49.149 28362-28578/g.convery.cat_sounds E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
06-01 12:45:49.345 28362-28362/g.convery.cat_sounds I/Choreographer: Skipped 89 frames!  The application may be doing too much work on its main thread.
06-01 12:45:49.430 28362-28580/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:52.534 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:52.548 28362-28626/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:54.110 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:45:54.253 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:54.261 28362-28679/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:54.704 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:45:55.171 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:55.183 28362-28695/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:55.650 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:45:55.851 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:55.884 28362-28706/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:56.053 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:56.068 28362-28710/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:56.693 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:56.707 28362-28721/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:57.321 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:57.334 28362-28732/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:57.680 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:57.693 28362-28738/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:58.540 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:58.550 28362-28752/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:58.951 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:58.959 28362-28762/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:45:59.466 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:45:59.846 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:45:59.858 28362-28776/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:01.074 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:01.081 28362-28795/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:01.819 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:01.831 28362-28806/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:02.792 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:02.803 28362-28821/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:03.831 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:03.850 28362-28836/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:04.832 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:04.839 28362-28851/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:05.929 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:05.931 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:46:05.944 28362-28867/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:07.047 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:46:07.496 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:07.506 28362-28892/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:07.960 28362-28362/g.convery.cat_sounds W/SoundPool:   sample 20 not READY
06-01 12:46:08.316 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:08.321 28362-28903/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:08.782 28362-28362/g.convery.cat_sounds W/SoundPool:   sample 23 not READY
06-01 12:46:09.059 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:09.065 28362-28915/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:09.545 28362-28362/g.convery.cat_sounds W/SoundPool:   sample 26 not READY
06-01 12:46:09.938 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:09.948 28362-28930/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:10.637 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:10.652 28362-28943/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:11.734 28362-28362/g.convery.cat_sounds W/SoundPool:   sample 33 not READY
06-01 12:46:11.756 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:11.763 28362-28958/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:12.395 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:12.404 28362-28969/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:12.823 28362-28362/g.convery.cat_sounds W/SoundPool:   sample 36 not READY
06-01 12:46:13.293 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:13.300 28362-28982/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:13.769 28362-28362/g.convery.cat_sounds W/SoundPool:   sample 38 not READY
06-01 12:46:14.419 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:14.431 28362-29000/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:15.645 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:15.655 28362-29016/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:16.624 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:16.634 28362-29031/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:17.402 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:17.411 28362-29042/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:18.426 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:18.430 28362-29058/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:19.259 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:19.269 28362-29072/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:19.420 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:19.424 28362-29075/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:20.139 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:20.148 28362-29086/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:20.483 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:20.493 28362-29091/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:22.028 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:22.033 28362-29112/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:23.028 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:23.033 28362-29130/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:23.200 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:23.210 28362-29135/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:23.981 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:23.985 28362-29149/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:24.336 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:24.345 28362-29154/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:24.560 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:24.566 28362-29161/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:25.454 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:25.466 28362-29174/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:26.331 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:26.339 28362-29187/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:27.666 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:27.674 28362-29205/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:28.800 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:28.813 28362-29220/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:29.153 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:29.160 28362-29229/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:29.332 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:29.338 28362-29233/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:29.581 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:29.588 28362-29240/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:30.188 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:30.198 28362-29250/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:30.235 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:30.243 28362-29253/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:30.562 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:46:30.572 28362-29258/g.convery.cat_sounds I/OMXClient: MuxOMX ctor
06-01 12:46:30.707 28362-28362/g.convery.cat_sounds E/Status: loading sound tracks (status=0)
06-01 12:48:27.512 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz
06-01 12:48:28.338 28362-28362/g.convery.cat_sounds W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44100 Hz, output 48000 Hz


来源:https://stackoverflow.com/questions/50635392/android-studio-soundpool-not-playing-sounds-sporadically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!