开发者

Android app pauses during sleep lock, but not its running native threads?

开发者 https://www.devze.com 2023-04-05 09:01 出处:网络
I am having a problem with the sleep lock in my application. I am using a native thread which is using sockets to retrieve RTP packets who contains audio data. This audio data is then sent to the and

I am having a problem with the sleep lock in my application. I am using a native thread which is using sockets to retrieve RTP packets who contains audio data. This audio data is then sent to the android audio player class in Java (MediaPlayer, I think - didn't write that piece myself) and is being played out.

What happens if, if I manually(not because its "idle") engage the sleep-lock, it seems the native threads keeps buffering audio data but the media player is not requesting it, which means once you deactivate the sleep lock you get like a 5-seconds delay.

I am using native library for buffering the RTP packtets (speex ji开发者_JAVA百科tterbuffer) and cannot do much about it im afraid. My question is then: how do I tell my app to continue playing sound after having manually activated the sleep lock?

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号