Why does SimpleAudioEngine behave differently on each platform, and is there a way to configure it? - cocos2d-x

I am using SimpleAudioEngine to play sound effects on my app. It works on Windows Phone 8.1 (Universal), Android, and iOS. But I noticed the following behaviour which is not consistent:
In iOS, if I am listen to music on the Apple Music app, and then I launch my game, the music is silenced.
In Android, the music from Google Play is continued to be played even after launching my app. I can also hear the sound effects from my game.
In Windows Phone the behaviour is the same as Android.
Why is it different for iOS, and is there some way this can be configured ?
I am using cocos2d-x v3.7 (C++)

On iOS, SimpleAudioEngine uses a different codebase, and the default settings in CDAudioManager are to play effects and music (only if no other music is playing). If you edit the CDAudioManager code you can change the default settings of SimpleAudioEngine, or alternatively, just use CDAudioManager on iOS.

Related

How to debug Webchat in iPhone Simulator

I was facing an issue on Audio not playing in voice bot in iPhone (Mic works) alone and was trying to debug the same in iPhone simulator in Mac (since I don't have access to a real device). However, in the simulator, the sample bot doesn't seem to be working. Here is the screengrab:
How am I supposed to debug this issue?
You'll need to test directly on an iPhone. Per the iPhone Simulator docs:
Hardware Differences
Though most of the functionality of devices can be simulated in Simulator, some hardware features must be tested directly on a device. The hardware features that are not simulated as of iOS 8.2 are:
Motion support (accelerometer and gyroscope) are unsupported.
Audio and video input (camera and microphone) are unsupported.

Audio output on Chrome when using WebRTC

I am using Chrome Version 62.0.3202.75 on macOS 10.12.6.
As of today, any WebRTC audio is now fed to my headset speaker. It would always use whatever the default speaker was set to in Mac sound setting (set to iMac speakers). This is the same in my app and all other WebRTC apps I have tried from.
YouTube and other sounds from the browser still come through the computer speakers as expected.
I can't find anyway to change this apart from unplugging headset and I can find no documentation / release notes on it. It does not happen in other browsers.
Any ideas?

MediaElement and native video player shows videos in wrong orientation

I have a problem while using MediaElement to play video. The video isn't shown in correct orientation if its VideoProperties.Orientation is different from VideoOrientation.Normal (e.g. VideoOrientation.Rotate90). Those videos can be recorded by native camera app while holding the phone vertically. It's strange that Windows Phone native video player also has the same problem and is always locked in landscape mode (this doesn't happen with IOS or Android video player). My question is : Does Windows Phone native video player use the same API to play video like MediaElement? In that case, is it possible that that API will be updated to fix this problem in future Windows Phone update? I need to confirm those things to make a suitable workaround for this problem.

Play audio through earpiece in Windows phone 8

I have an mp3 file and I want to play it through the earpiece rather than the phone's speakers. Since I want the playing to happen, even when in background, I have implemented a Windows Phone Audio Play back agent. Now how can I play the audio in earpiece only?
If you use the MediaElement provided to you in the Windows Phone Toolbox you wouldn't have to implement a play back agent or decide what speaker to play it through. If you plug in your earphones the phone will direct audio coming from the MediaElement to the audio jack. This is the native behavior of MediaElement and all mobile sound components.

HTLM5 canvas game (easeljs) slow peformance on ipad (ios7) with phonegap

I have developed a game with easeljs for HTML5 Canvas.
the game is a single HTML5 page with canvas and a lot of javascript.
All this time I tested the app on iOS Safari (iPad3 iOS7) with 40~50 fps via a local server.
when I packed in a xcode app with phonegap, it becomes incredible slow near to 10fps..
I noticed the same behaviour when I added the page to homescreen.
There is any way to make make a good performance with html5 canvas app games for ipad (iOS7)?
Don't use Phonegap. Try CocoonJS!
Ok, I found the solution for this.
The actual phonegap implementation uses default webViewer, which is quite slow. Ludei (www.ludei.com) has a great solution for HTML5 canvas high performance games, CocoonJS. It works great on iOS and Android, there is not for WindowsPhone. However there is no need for it on Windows Phone 8. Windows Phone 8 has the highest native HTML5 canvas performance I ever seen.
so Don't use Phonegap. Try CocoonJS!