13

Is there a way to tell the iOS simulator which audio device connected to your computer you want it to use?

The simulator seems to pick whatever audio device is last connected to your machine. I've got a USB audio device (fasttrack pro) I use for my main sound playback and then a USB headset I use for my skype calls. More often than not, the simulator's audio is played on the headset instead of my main speakers.

Kara
  • 6,115
  • 16
  • 50
  • 57
Jay
  • 4,480
  • 3
  • 25
  • 22

8 Answers8

11

Ok, I found that both the input and output device much match in system sound settings. Often I have them set to different devices. If they don't match, the simulator seems to default to the last connected audio device selected among the input and output devices.

Jay
  • 4,480
  • 3
  • 25
  • 22
7

On a related note: if you're like me and don't like interface sounds and therefore uncheck the preference "Play user interface sound effects" (Sound > Sound Effects), you'll need to check it to get sound out of the simulator.

Pete Hutch
  • 79
  • 2
3

I doubt the simulator has a setting for that, but you can set the main output device in System Preferences > Sound.

crimson_penguin
  • 2,728
  • 1
  • 17
  • 24
1

Don't know if this will fix your issue, but it fixed mine.

I wanted the iOS simulator to output sound through a device I had connected and not the internal speakers. When I select the System Prefs Sound and selected my device as output, it would not work.

So, I selected the Sound Effects tab from the Prefs - Sound window and selected my device under Play Sound effects Through and presto it worked.

Don't know the in-outs of iphone sound, but apparently mine were being treated as sound effects.

Hope that helps, if not, I gave it a shot.

Rick S
  • 11
  • 1
  • Thanks Rick. I've had the sound effects output set to the m-audio fast track pro audio device too and still get the problem. – Jay Feb 10 '11 at 00:56
  • This works. I was using system sound APIs on the iOS device and it looks like those are indeed routed through the system sounds. – Tod Cunningham May 16 '11 at 04:18
  • This worked for me, but it also rerouted my Spotify music to that speaker which I wasn't wanting. – Ben Patch Oct 12 '16 at 17:59
0

Open iOS Simulator, under Hardware toolbar you can control Audio Input, Audio Output, and volume as well! I think it was added at Xcode 9.2, and that it's available only when running simulator with iOS 11 and above

brkeyal
  • 1,317
  • 1
  • 16
  • 22
0
func vibratePhone() {
    if (UIDevice.current.model == "iPhone") {
        AudioServicesPlaySystemSound(1352)
    } else {
        AudioServicesPlayAlertSound(1105)
    }
}

1352 Is the system sound ID for Vibration and 1105 is for Tock.caf if the user's device is an iPad or an iPod Tock.caf will be played in place of vibration.

0

For me, I tried all the solutions and nothing worked. Until I found the "silent switch" of the simulator and unmuted the phone and the sound started working!

Mahdi
  • 1,778
  • 1
  • 21
  • 35
-1

Working on an audio project on my studio and still didn't got it working on MOTU Hardware with everything pointing to the interface! All system sounds route properly except the iOS Sim!

Did this workaround:

iOS Sim/OS X -> SoundFlower virtual I/O -> (Any audio program like Logic/Live) -> MOTU HW

This might give you the freedom to route your audio as you please ;)