iOS Simulator Sound

前端 未结 7 1064
无人共我
无人共我 2021-01-04 06:12

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 las

相关标签:
7条回答
  • 2021-01-04 06:53

    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.

    0 讨论(0)
  • 2021-01-04 06:56

    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 ;)

    0 讨论(0)
  • 2021-01-04 06:57

    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.

    0 讨论(0)
  • 2021-01-04 06:59

    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

    0 讨论(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 讨论(0)
  • 2021-01-04 07:06

    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.

    0 讨论(0)
提交回复
热议问题