346

The situation goes a little something like this:

  1. I am programming Xcode whilst concurrently listening to music on my Bluetooth headphones... you know to block out the world.

  2. Then, I go to launch my app in the iOS simulator and BOOM all of a sudden my crystal clear music becomes garbled and super low quality like it is playing in a bathtub 2 blocks away... in the 1940s.

  3. Note: the quality deterioration does NOT occur if I am playing music on my laptop or cinema display and I launch the sim. It seems to be exclusively a Sim -> Bluetooth issue.

The problem is more than just annoying. Because often after stopping the simulator the crappy bathtub quality music continues. To fix it I have to open sound preferences in OSX and briefly toggle back to my laptop sound and then back to my Bluetooth headphones.

This is a big deal because I launch the simulator 50x a day and have to do this toggle thing every time as well as suffer listening to 40s era mono ham radio quality music.

For your information, the headphones I am using are Plantronics BackBeat Pro and I am up to date on firmware. I am on OSX 10.11.4 and Xcode 7.3... but this problem has persisted through all versions for 2+ years now. Can you save me from the 1940s?

world
  • 3,932
  • 2
  • 10
  • 12
  • 2
    It sounds like you should file a radar at http://bugreport.apple.com – Jeremy Huddleston Sequoia Jun 19 '16 at 06:03
  • Dealing with a similar issue, except in my case the sound quality goes to crap (or the music stops outright) when I kill an app on the simulator. I'm getting around it by running all my music through my phone, but wish I didn't have to. Even worse and more strange: if I quit the simulator, my wireless Logitech mouse stops working entirely! I have to unplug and re-plug the USB receiver. Really strange and annoying. – Reid Jul 27 '16 at 15:39
  • 1
    I have the same problem with the same headphones - when playing through bluetooth, the minute an app I'm working in is playing sound, the microphone turns on and the sound quality greatly deteriorates. It's easily reproducible with an app that simply uses `AudioServicesCreateSystemSoundID()` to load a sound file and then calls `AudioServicesPlaySystemSound()` to play it. – Dan Oct 20 '16 at 14:07
  • I have the exact same problem. Also filed a bug report at bugreport.apple.com – Roland T. Oct 27 '16 at 12:10
  • 6
    Same issue here, my wireless headphones: Bose Quiet Comfort 35. – Almir Filho Dec 30 '16 at 20:06
  • I was literally about to send my Beats in for repair because of this, glad i'm not the only one with the issue! – liamnichols Jun 05 '17 at 09:02
  • Please mark https://stackoverflow.com/a/46837022/865175 as the solution! – Iulian Onofrei Jun 28 '18 at 09:54
  • What if I use Mac Mini which doesn't have internal microphone option at all? – Richard Topchii Apr 15 '19 at 11:54

5 Answers5

405

I've managed to fix it, and it actually seems to be a microphone issue. Go to System Preferences -> Sound, select the Input tab and set Internal Microphone as the input (mine was set with my headphones').

system preferences print screen

Crappy sound goes way after that =)

EDIT (May 30 2018):

I've found out an easier way to do the same as above. Instead of opening the System Preferences, you can just go to the Mac OSX toolbar, press Option (alt) + click on the sound icon and then select "Internal Microphone" from the "Input Device" list. Print screen as follows.

input selection from toolbar

Almir Filho
  • 4,671
  • 1
  • 14
  • 14
  • 12
    Fixed it for me too (also with Bose QC35) – wonder why this happens :\ – Kevin Jantzer Jan 09 '17 at 16:21
  • 7
    kind of lame that if you want to use the mic in your bose headphones that the audio quality goes to shit – odyth Feb 05 '17 at 09:15
  • "Call Ended" she says – wfbarksdale Mar 25 '17 at 00:17
  • 4
    The headphones are switching to their call mode where frequencies are being filtered out. My guess is that when the simulator asks for the microphone to turn on, it switches the headphone mode or something – CoderDake Jun 08 '17 at 15:54
  • 2
    Thank you!! Now I can listen to music while coding again. If anyone's curious I took a look at the audio codec. Occasionally when the simulator is open it will switch from AAC to SCO, which seems to cause a deterioration in quality. Quitting the simulator will change the codec back to AAC. – Swemoph Jun 27 '17 at 07:34
  • 1
    This happens because the android emulator starts tapping the microphone input the second it boots up. And there seems no way to disable this behavior, which creeps me the heck out.... Either way, because the micrphone gets activated, the OS switches a kind of 'phone mode' (a different bluetooth profile). Same thing happens when using Skype, for example. – Kevin R Aug 01 '17 at 08:52
  • My Sony MDR-XB950b1 stats playing the same crappy sound and after a while it just disconnects, this solution worked for me. – gomezluisj Oct 04 '17 at 15:39
  • Fixed for my QC35 as well :) Thanks! – Jaran Oct 24 '17 at 07:07
  • 20
    For people using Mac Mini (no default input), use 'Soundflower' and set the simulator input to a different channel. https://github.com/mattingalls/Soundflower – SwingerDinger Nov 14 '17 at 15:20
  • Fixed same problem with android emulator, Thank you! – Idanatz Nov 26 '17 at 14:12
  • This is happening as well in Android. In my case sometimes it had a mono 16khz sound, and some others good audio but almost all the sound balance was on the left ear. This settings page had control over that and I managed to fix it – Reinherd Feb 07 '18 at 18:55
  • @SwingerDinger you should really make your comment an answer of it's own. This is the only thing that reliably worked for me on a mac mini (which has no "internal speakers") – johnny Nov 12 '19 at 17:34
  • Macmini does not show another mic input so I'm doomed. – Abdul Sadik Yalcin Jan 08 '20 at 14:30
  • Awesome. The Option (alt) + click on the sound icon approach is so much easier. Wish Apple fixes in the next Xcode version. Thanks! – Vinayak Jun 03 '20 at 12:41
334

If you're using Xcode 9 or higher, you can set a default audio input and output for the simulator. This can be done by launching the simulator from Xcode and navigating to I/O > Audio Input within the menu bar and selecting Internal Microphone. This solution will save your audio preference so you won't have to change it on every launch.

Audio Input Setting

Cezar
  • 55,636
  • 19
  • 86
  • 87
Ovi Bortas
  • 3,412
  • 1
  • 13
  • 10
15

On Simulator, Select;

I/O -> Audio Input -> Macbook [Pro]

Done.

Simulator Audio Input

muhasturk
  • 2,534
  • 20
  • 16
  • 4
    Any solution for Mac Pros which does not have an internal mic so there is nothing to switch to? – ROC Nov 29 '20 at 09:46
5

Seems like years of suffering are finally over, Xcode 12 Beta Release Notes:

Simulator defaults to the internal microphone unless you explicitly choose a different audio source. This avoids triggering phone call mode on Bluetooth headsets which degrades audio quality while listening to music. (59338925, 59803381)

Max O
  • 997
  • 8
  • 13
0

enter image description hereYou can also switch to Mac's internal mic in System Preferences -> Sound, that's how I usually fix this bug (I have Sony Wh-1000XM3)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
macL0vin
  • 183
  • 2
  • 11