You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Sounds 0.8.9
Tested on Android Emulator (debug mode)
Not sure if I'm doing this incorrectly, or if there is an issue with the library.
I initialize with:
SoundPlayer.withUI(canSkipForward: true, canSkipBackward: true);
Upon clicking the "forward/backward" buttons in the OS shade the event propagates to the onSkipForward/onSkipBackward listeners which then call .stop() and move to the next item in the playlist array and call .play() (I'm not using the Album part of the API as each "track" actually consists of sequentially playing through more than one sound clip with silent delays between each clip).
The above works fine until I dispose/release at which point the error message "E/SoundPlayer(13652): MediaPlayerOnPreparedListener timer: mMediaBrowserHelper.mediaControllerCompat is NULL. This is BAD !!!" starts spamming the console.
If I just call release() after every stop() then the error never happens, however that means that the OS shade slides out for a second and then back in everytime the forward/back buttons are pressed by the user.
If the sounds are allowed to stop on their own (e.g., naturally reach the end of their duration) then the next playlist item plays fine and no errors propagate. It only happens if I manually call stop() without calling release(). I believe my only option right now would be to get the sound duration and seekTo near the end and let it stop itself, but that doesn't seem like the right way to handle this.
To simplify, I'm looking to do the following:
Start playing an audio clip > play()
User taps Next in the OS shade > await stop()
Audio stops immediately and plays next clip > play()
Leave route/screen > release()
Just let me know if you all need any more details or if I'm just not handling this scenario correctly.
Here's a small sample that triggers the error when you play the sound, skip to next sound, release sound.
I need Help for:
Using Sounds 0.8.9
Tested on Android Emulator (debug mode)
Not sure if I'm doing this incorrectly, or if there is an issue with the library.
I initialize with:
SoundPlayer.withUI(canSkipForward: true, canSkipBackward: true);
Upon clicking the "forward/backward" buttons in the OS shade the event propagates to the onSkipForward/onSkipBackward listeners which then call .stop() and move to the next item in the playlist array and call .play() (I'm not using the Album part of the API as each "track" actually consists of sequentially playing through more than one sound clip with silent delays between each clip).
The above works fine until I dispose/release at which point the error message "E/SoundPlayer(13652): MediaPlayerOnPreparedListener timer: mMediaBrowserHelper.mediaControllerCompat is NULL. This is BAD !!!" starts spamming the console.
If I just call release() after every stop() then the error never happens, however that means that the OS shade slides out for a second and then back in everytime the forward/back buttons are pressed by the user.
If the sounds are allowed to stop on their own (e.g., naturally reach the end of their duration) then the next playlist item plays fine and no errors propagate. It only happens if I manually call stop() without calling release(). I believe my only option right now would be to get the sound duration and seekTo near the end and let it stop itself, but that doesn't seem like the right way to handle this.
To simplify, I'm looking to do the following:
Just let me know if you all need any more details or if I'm just not handling this scenario correctly.
Here's a small sample that triggers the error when you play the sound, skip to next sound, release sound.
The text was updated successfully, but these errors were encountered: