iOS Simulator Sound

与世无争的帅哥 提交于 2020-01-10 23:03:21

问题


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.


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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.




回答5:


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




回答6:


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.




回答7:


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



来源:https://stackoverflow.com/questions/4772112/ios-simulator-sound

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!