How to prevent Web-Audio on iOS from switching to mono when accessing the microphone? - ios

we are developing a web app, that is supposed to play high quality stereo in combination with accessing the microphone input. We got this to work on all android and pc browsers, but the iphone is refusing to do this properly. We nailed the problem down to the access of the microphone input by "getUserMedia". Web audio plays stereo, until the microphone is enabled. Then, the quality drops and the output goes to mono. I have researched this problem in the internet, but only found posts that are several years old. My hope is, that things have changed in the meantime and solutions have been found. It seems like the phone is switching into some kind of "call mode". I would like to avoid this by either overriding corresponding settings or maybe by using a different way than using web-audio to play the stereo signal. I am open for any ideas. The worst case seems that we have to develop a dedicated native app for ios. If there is any workaround to make this happening in a web app, this would be highly appreciated. If desired, I can provide code snipplets, but I think, at this moment the problem should be clear.
BTW, in android we had similar problems and found that "Dolby Atmos" setting is causing strange mixing down to mono under certain circumstances. Switching it off fixed the android issues. Maybe this helps somebody else and maybe there are global settings on the iphone as well that could cure the problem..
Thank you very much in advance!
Cheers,
Chris

The worst case seems that we have to develop a dedicated native app for ios.
Unfortunately, this is the path forward most likely to yield success for you (if you haven't already figured this problem out, since I'm answering your question almost a year later).
The audio I/O device landscape is complicated, and there are several standards and factors that play into the quality of audio input and output an application yields. For instance:
Is the audio input device the same as the audio output device?
If yes, is the audio I/O device Bluetooth?
If yes, it's unlikely that the Bluetooth audio device supports stereo audio out and simultaneous audio input. Few I/O devices support that, and few host devices support that.
If yes, which Bluetooth version does the I/O device support?
Which operating system is the host device running?
Does the host device's operating system support the selection of audio input and output devices separately?
How much access to the host operating system does your application have?
For example, if your application is running in a browser, your application will have significantly less control over the host device's operating system's audio subsystem.

I have been trying to work around this problem recently, too. Another developer did a detailed investigation of this using a spectrum analyser and scope, and didn't have any luck either: testing iOS audio play/record with scope.
I think building a native app will end up being inevitable, and would also fix the myriad other problems with Safari web audio. Either that or wait until Apple fixes the bugs or implements AudioWorklets.

Related

Audio in Unity WEBGL on IOS devices

I have a problem getting my audioclips to play on ios devices in webgl. I have seen other games with audio working so i know it is possible. Now after 3 days of trying to fix the issue with no luck i really hope you can help me with the problem. I know a solution where you can add some meta tags and save it as a Webapp on your phone. But that is not the solution i am looking for.
Here is an example of a game where the audio works fine in an ios browser http://temple-run2.com/
I quote:
Note that Unity WebGL content is not currently supported on mobile devices. It may still work, especially on high-end devices, but many current devices are not powerful enough and don’t have enough memory to support Unity WebGL content well.
more info
As so, uncontrolled behavior may (very likely) occur on mobile devices.
I know a solution where you can add some meta tags and save it as a
Webapp on your phone.
What is wrong with just building to iOS nativly?
If you really need 3D content in a webbrowser that's supported on mobile devices, take a look at threejs

Robotic voice through iphone 6s microphone

I am developing an app to do live video streaming and when I recently upgraded to an iPhone 6s, all noise going through the microphone sounds robotic (or like a cricket). I can reproduce this issue only using the skype app, but no other app have this similar output. The skype support forums say that this is a problem they're seeing on iPhone 6s [1] but don't give any details as to what's causing it.
The interesting thing is it doesn't have issues when I use the microphone jack via my headphones, only when the built in microphone is used. Is there a permission or a change I need to make to my app to fix this?
[1] - http://community.skype.com/t5/iOS-iPhone-and-iPad/iPhone-6s-Distorted-sound/td-p/4138308
The 6S is apparently locked to a 48000 sample rate when using the built in microphone. Maybe you tried to set the format to 44100. I think the only way to deal with this is to query an active AVAudioSession for it's sampleRate property and set your format's sample rate to that.
This is a know issue consumer users are seeing. It might be the iOS 9 update was not working properly.
Here's a source (might not be that trusted for some but it's a start)
http://9to5mac.com/2015/09/30/iphone-6s-touch-id-3d-touch-speaker-power-issues/
You can try a different app from the App Store, or call someone on speaker, to check if the issues is reproducible.

Bluetooth Low Energy Emulate Keypress

I am playing around with a TI CC2541 chip, and was wondering if it is possible to send a "keypress" over BLE. This would be similar to the new Muku Shutter for iOS and Android, because I am trying to figure out a way to interface with a mobile device without installing a 3rd party application. Essentially, I would press the button on the CC2541 chip, and then it would emulate a keypress of volume up?
I have been researching for a while now, and all solutions to handle this have included writing a 3rd party application to map the commands in the BLE packet to a system command.
Any help would greatly be appreciated. Thank you!
On iOS the answer is no
Edit:
Exception: You might be able to set up your BT chip as a Bluetooth keyboard.
You could certainly write an app that talks with a remote BLE device and uses an agreed-upon protocol to pass key presses to your app, and then you could interpret those messages using code in your app.
However, Apple enforces a "sandbox" on its apps, and apps are not allowed to interact directly with the system except through very tightly controlled set of APIs. If there is not an official interfere to do something, it is not allowed.
If you were to run on a jailbroken device then the answer would likely be different. I can't help you there however.
Edit:
#OliverMason says in a comment that iOS shutter buttons are apparently single-key BlueTooth keyboards that emulate the volume up button, which the camera app recognizes as a way to trigger a photo. Thus my answer above isn't quite accurate.

Why isn't AUNetSend available on iOS? (Or any alternative suggestions)

I just tried AUNetSend and AUNetReceive on two Macs using garageband. The delay was exceptionally low! I am very disappointed to find that AUNetSend is not available on iOS, however. I'm trying to stream audio from an iOS device to a receiver app on my Mac. Does anyone have any alternative suggestions as to go about doing this? Here's what I'm trying to do essentially. It must have very low latency, so GKVoiceChat won't work.
audio+midi can be routed from and to iPad, via USB to PC/MAC, thanks to iConnectMIDI+ devices

Why does my application audio stop working after turning off and turning on my tv?

I'm currently developing an application in XNA and using a TV with HDMI for video and audio. When I turn the TV off then on again the application audio ceases to work. However, system sounds do still work. Does anyone have any ideas on why this happens?
I'm using a motherboard with integrated Intel HD graphics to connect the TV and use it as a monitor.
Here is a link to a similar issue in regards to audio jack sensing in windows:
https://superuser.com/questions/249878/disable-windows-sound-card-jack-sensing
The same solution solved my problem:
Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4D36E96C-E325-11CE-BFC1-08002BE10318}000\GlobalSettings
Change the value EnableDynamicDevices to zero.
Restart your system.
Hopefully this will help others that have issues with this and XNA in the future.

Resources