[LayaAir 1.0]背景音乐来回切换报错

07-16 13:28:21.072 1331-1384/com.layabox.game I/LayaBox: JCAudioManager::stopMp3
07-16 13:28:21.072 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>>>>>>>>>>>>>>>>>className:layaair.game.utility.LayaAudioMusic,methodName:stopBackgroundMusic
07-16 13:28:21.072 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>before
07-16 13:28:21.112 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>after
07-16 13:28:21.112 1331-1384/com.layabox.game I/LayaBox: JCAudioManager::pauseMp3
07-16 13:28:21.112 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>>>>>>>>>>>>>>>>>className:layaair.game.utility.LayaAudioMusic,methodName:pauseBackgroundMusic
07-16 13:28:21.112 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>before
07-16 13:28:21.112 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>after
07-16 13:28:21.122 1331-1384/com.layabox.game I/LayaBox: JCAudioManager::stopMp3
07-16 13:28:21.122 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>>>>>>>>>>>>>>>>>className:layaair.game.utility.LayaAudioMusic,methodName:stopBackgroundMusic
07-16 13:28:21.122 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>before
07-16 13:28:21.122 1331-1384/com.layabox.game E/LayaBox: >>>>>>>>>>>>after
07-16 13:28:21.312 172-474/? W/FFmpegExtractor: sniff through BetterSniffFFMPEG failed, try LegacySniffFFMPEG
07-16 13:28:21.322 172-474/? E/FFmpegExtractor: /data/data/com.layabox.game/LayaCache/appCache/9ea141a6/18ac4122_dreams.mp3: avformat_open_input failed, err:Permission denied
07-16 13:28:21.322 1331-1331/com.layabox.game E/MediaPlayer: Should have subtitle controller already set
    
    --------- beginning of /dev/log/system
07-16 13:28:37.142 402-531/? I/ActivityManager: Process com.layabox.game (pid 1331) has died.
07-16 13:28:37.142 402-521/? W/NetworkManagementSocketTagger: setKernelCountSet(10030, 0) failed with errno -13
07-16 13:28:37.142 402-531/? W/ActivityManager: Force removing ActivityRecord{4a9b4018 u0 com.layabox.game/demo.MainActivity t2}: app died, no saved state
07-16 13:28:37.152 402-413/? I/WindowState: WIN DEATH: Window{4a9455c8 u0 com.layabox.game/demo.MainActivity}
07-16 13:28:37.152 402-413/? W/WindowManager: Force-removing child win Window{4a9533a0 u0 SurfaceView} from container Window{4a9455c8 u0 com.layabox.game/demo.MainActivity}
07-16 13:28:37.152 402-748/? W/WindowManager: Failed looking up window
    java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@4a9196d8 does not exist
        at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8111)
        at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8102)
        at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1051)
        at android.os.BinderProxy.sendDeathNotice(Binder.java:493)
        at dalvik.system.NativeStart.run(Native Method)
07-16 13:28:37.152 402-748/? I/WindowState: WIN DEATH: null
07-16 13:28:37.232 670-670/? W/EGL_emulation: eglSurfaceAttrib not implemented 3093 12436
07-16 13:28:37.232 402-748/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1123 com.android.server.InputMethodManagerService.hideCurrentInputLocked:1880 com.android.server.InputMethodManagerService.windowGainedFocus:1968 com.android.internal.view.IInputMethodManager$Stub.onTransact:221 com.android.server.InputMethodManagerService.onTransact:818 
07-16 13:28:37.232 402-748/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 1331 uid 10030
07-16 13:28:37.302 647-667/? W/Binder: Caught a RuntimeException from the binder stub implementation.
    java.lang.NullPointerException
        at android.inputmethodservice.IInputMethodWrapper.setSessionEnabled(IInputMethodWrapper.java:280)
        at com.android.internal.view.IInputMethod$Stub.onTransact(IInputMethod.java:129)
        at android.os.Binder.execTransact(Binder.java:404)
        at dalvik.system.NativeStart.run(Native Method)
07-16 13:28:37.702 1760-1760/? D/AndroidRuntime: >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
07-16 13:28:38.562 1760-1760/? D/AndroidRuntime: CheckJNI is OFF
07-16 13:28:38.622 1760-1760/? D/dalvikvm: Using executionMode 2
07-16 13:28:38.832 1760-1760/? D/dalvikvm: Trying to load lib libjavacore.so 0x0
07-16 13:28:38.832 1760-1760/? D/dalvikvm: Added shared lib libjavacore.so 0x0
07-16 13:28:38.832 1760-1760/? D/dalvikvm: Trying to load lib libnativehelper.so 0x0
07-16 13:28:38.832 1760-1760/? D/dalvikvm: Added shared lib libnativehelper.so 0x0
07-16 13:28:38.832 1760-1760/? D/dalvikvm: No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
07-16 13:28:38.872 1760-1760/? D/dalvikvm: Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
07-16 13:28:38.922 1760-1760/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-16 13:28:38.922 1760-1760/? E/android.os.Debug: failed to load memtrack module: -2
07-16 13:28:38.952 1760-1760/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
07-16 13:28:38.962 1760-1760/? D/AndroidRuntime: Shutting down VM
07-16 13:28:38.962 1760-1768/? D/dalvikvm: Debugger has detached; object registry had 1 entries
07-16 13:28:38.962 1760-1770/? I/AndroidRuntime: NOTE: attach of thread 'Binder_2' failed
已邀请:

Nevermore

赞同来自:

代码很简单 先load 再play 
let dreamsSound:Laya.SoundChannel = null
        Laya.loader.load("res/dreams.mp3",Laya.Handler.create(this,function(){
            dreamsSound = Laya.SoundManager.playMusic("res/dreams.mp3")
        })) 
        let mainSound:Laya.SoundChannel = null;
        this.btn_sound.on(Laya.Event.CLICK,this,function(){
            dreamsSound = null;
            if(mainSound == null){
                Laya.loader.load("res/main.mp3",Laya.Handler.create(this,function(){
                    mainSound = Laya.SoundManager.playMusic("res/main.mp3")
                }))
            }else{
                mainSound.startTime = mainSound.position;
            }
        }) 
        this.btn_sound_ex.on(Laya.Event.CLICK,this,function(){
            mainSound = null;
            if (dreamsSound == null) {
                Laya.loader.load("res/dreams.mp3", Laya.Handler.create(this, function () {
                    dreamsSound = Laya.SoundManager.playMusic("res/dreams.mp3")
                }))
            } else {
                dreamsSound.startTime = dreamsSound.position;
            }
        })

Aar0n

赞同来自:

无法复现,快速切换没发现异常,请提供复现方法

Nevermore

赞同来自:

求解··

Nevermore

赞同来自:

没有回复了?

要回复问题请先

商务合作
商务合作