{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16215","repository_url":"https://api.github.com/repos/cocos2d/cocos2d-x","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16215/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16215/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16215/events","html_url":"https://github.com/cocos2d/cocos2d-x/issues/16215","id":167512493,"number":16215,"title":"Different behavior of AudioEngine on different platfroms","user":{"login":"dumganhar","id":493372,"avatar_url":"https://avatars.githubusercontent.com/u/493372?v=3","gravatar_id":"","url":"https://api.github.com/users/dumganhar","html_url":"https://github.com/dumganhar","followers_url":"https://api.github.com/users/dumganhar/followers","following_url":"https://api.github.com/users/dumganhar/following{/other_user}","gists_url":"https://api.github.com/users/dumganhar/gists{/gist_id}","starred_url":"https://api.github.com/users/dumganhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dumganhar/subscriptions","organizations_url":"https://api.github.com/users/dumganhar/orgs","repos_url":"https://api.github.com/users/dumganhar/repos","events_url":"https://api.github.com/users/dumganhar/events{/privacy}","received_events_url":"https://api.github.com/users/dumganhar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/labels/module:audio","name":"module:audio","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"dumganhar","id":493372,"avatar_url":"https://avatars.githubusercontent.com/u/493372?v=3","gravatar_id":"","url":"https://api.github.com/users/dumganhar","html_url":"https://github.com/dumganhar","followers_url":"https://api.github.com/users/dumganhar/followers","following_url":"https://api.github.com/users/dumganhar/following{/other_user}","gists_url":"https://api.github.com/users/dumganhar/gists{/gist_id}","starred_url":"https://api.github.com/users/dumganhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dumganhar/subscriptions","organizations_url":"https://api.github.com/users/dumganhar/orgs","repos_url":"https://api.github.com/users/dumganhar/repos","events_url":"https://api.github.com/users/dumganhar/events{/privacy}","received_events_url":"https://api.github.com/users/dumganhar/received_events","type":"User","site_admin":false},"assignees":[{"login":"dumganhar","id":493372,"avatar_url":"https://avatars.githubusercontent.com/u/493372?v=3","gravatar_id":"","url":"https://api.github.com/users/dumganhar","html_url":"https://github.com/dumganhar","followers_url":"https://api.github.com/users/dumganhar/followers","following_url":"https://api.github.com/users/dumganhar/following{/other_user}","gists_url":"https://api.github.com/users/dumganhar/gists{/gist_id}","starred_url":"https://api.github.com/users/dumganhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dumganhar/subscriptions","organizations_url":"https://api.github.com/users/dumganhar/orgs","repos_url":"https://api.github.com/users/dumganhar/repos","events_url":"https://api.github.com/users/dumganhar/events{/privacy}","received_events_url":"https://api.github.com/users/dumganhar/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/milestones/29","html_url":"https://github.com/cocos2d/cocos2d-x/milestones/3.13","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/milestones/29/labels","id":1768287,"number":29,"title":"3.13","description":"","creator":{"login":"minggo","id":488203,"avatar_url":"https://avatars.githubusercontent.com/u/488203?v=3","gravatar_id":"","url":"https://api.github.com/users/minggo","html_url":"https://github.com/minggo","followers_url":"https://api.github.com/users/minggo/followers","following_url":"https://api.github.com/users/minggo/following{/other_user}","gists_url":"https://api.github.com/users/minggo/gists{/gist_id}","starred_url":"https://api.github.com/users/minggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minggo/subscriptions","organizations_url":"https://api.github.com/users/minggo/orgs","repos_url":"https://api.github.com/users/minggo/repos","events_url":"https://api.github.com/users/minggo/events{/privacy}","received_events_url":"https://api.github.com/users/minggo/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":132,"state":"open","created_at":"2016-05-16T09:52:30Z","updated_at":"2016-07-28T09:45:19Z","due_on":"2016-08-29T16:00:00Z","closed_at":null},"comments":7,"created_at":"2016-07-26T03:16:10Z","updated_at":"2016-07-28T09:45:30Z","closed_at":null,"body":"Currently, audio pause/resume logic on iOS will be controlled automatically.\r\nBoth `SimpleAudioEngine` & `New AudioEngine` on iOS achieve in that way, but other platforms are not implemented. So developers have to invoke `AudioEngine::pauseAll/resumeAll` in the Applegate.cpp, some code like:\r\n```c++\r\n// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked.\r\nvoid AppDelegate::applicationDidEnterBackground() {\r\n    Director::getInstance()->stopAnimation();\r\n\r\n    // if you use SimpleAudioEngine, it must be paused\r\n    SimpleAudioEngine::getInstance()->pauseBackgroundMusic();\r\n    SimpleAudioEngine::getInstance()->pauseAllEffects();\r\n    // if using new audio engine\r\n    AudioEngine::pauseAll();\r\n}\r\n\r\n// this function will be called when the app is active again\r\nvoid AppDelegate::applicationWillEnterForeground() {\r\n    Director::getInstance()->startAnimation();\r\n\r\n    // if you use SimpleAudioEngine, it must resume here\r\n    SimpleAudioEngine::getInstance()->resumeBackgroundMusic();\r\n    SimpleAudioEngine::getInstance()->resumeAllEffects();\r\n   // if using new audio engine\r\n   AudioEngine::resumeAll();\r\n}\r\n```\r\n\r\nDevelopers are confused, they complain that why should we invoke these method for Android while their games run perfectly on iOS.\r\n\r\nAny thoughts about this? Should we implement the same automatic `pause/resume` strategy for all platforms?"},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/235849405","html_url":"https://github.com/cocos2d/cocos2d-x/issues/16215#issuecomment-235849405","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/16215","id":235849405,"user":{"login":"minggo","id":488203,"avatar_url":"https://avatars.githubusercontent.com/u/488203?v=3","gravatar_id":"","url":"https://api.github.com/users/minggo","html_url":"https://github.com/minggo","followers_url":"https://api.github.com/users/minggo/followers","following_url":"https://api.github.com/users/minggo/following{/other_user}","gists_url":"https://api.github.com/users/minggo/gists{/gist_id}","starred_url":"https://api.github.com/users/minggo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minggo/subscriptions","organizations_url":"https://api.github.com/users/minggo/orgs","repos_url":"https://api.github.com/users/minggo/repos","events_url":"https://api.github.com/users/minggo/events{/privacy}","received_events_url":"https://api.github.com/users/minggo/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T09:45:30Z","updated_at":"2016-07-28T09:45:30Z","body":"done"}}
{"actor":{"display_login":"minggo"}}