{"id":1524,"date":"2022-08-30T15:17:15","date_gmt":"2022-08-30T15:17:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/26\/stream-audio-with-screen-off-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:17:15","modified_gmt":"2022-08-30T15:17:15","slug":"stream-audio-with-screen-off-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/stream-audio-with-screen-off-collection-of-common-programming-errors\/","title":{"rendered":"stream audio with screen off-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to stream an audio file while the screen is oFF. I&#8217;m using the MediaPlayer class. I&#8217;ve managed to play the audio (mp3) while the screen is ON. Also to play a video while the screen is OFF.These two worked well. However, when I play the audio while the screen is OFF I got the following messages in logcat:<\/p>\n<pre><code>06-16 13:52:22.977: WARN\/TimedEventQueue(59): Event 3 was not found in the queue, already cancelled?\n06-16 13:52:23.207: WARN\/MediaPlayer(11489): mediaplayer went away with unhandled events\n06-16 13:52:23.207: WARN\/MediaPlayer(11489): mediaplayer went away with unhandled events\n<\/code><\/pre>\n<p>I&#8217;ve tried to use a wakelock without succeed:<\/p>\n<pre><code>mMediaPlayer.setWakeMode(getBaseContext(), PowerManager.PARTIAL_WAKE_LOCK);\n<\/code><\/pre>\n<p>Any other suggestion of what should I try?<\/p>\n<p>really appreciate your help,<\/p>\n<p>\/cristobal<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-26 18:03:46. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to stream an audio file while the screen is oFF. I&#8217;m using the MediaPlayer class. I&#8217;ve managed to play the audio (mp3) while the screen is ON. Also to play a video while the screen is OFF.These two worked well. However, when I play the audio while the screen is OFF I got [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1524","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1524","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1524"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1524\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}