iOS Simulator Sound - ios

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.

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.

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.

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

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.

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

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.

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

Related

Xcode iPhone simulator keyboard press messing with computer audio quality

When a keyboard press is done in the simulator, it seems the audio of the simulator takes over, and in turn, makes the audio quality of a youtube video play poorly. The problem is fixed once I quit the simulator and refresh the video.
Any quick fixes for this problem?
Thanks in advance.
This is likely keyboard click sounds playing which can push BlueTooth devices into "phone call" mode with a low bit rate codec.
You can avoid that by selecting the internal microphone as the input device for simulators.
Xcode 11.3.1 & earlier: Device > Audio Input > Internal Microphone
Xcode 11.4+: I/O > Audio Input > Internal Microphone
Xcode 12+: By default non-Bluetooth input devices are always preferred if available. If you do want to use BT headphones for input manually select them in I/O > Audio Input.

Unity - audio files play badly on iPhone and iPad

Suddenly all my sounds sound really weird on the iphone and ipad, but they still sound ok in the Editor.
On the devices they sound similar to if they were played through a bad telephone connection over speaker - or if they were recorded with poor quality. And again, this only happens on the iPhone and iPad devices, in Unity itself it's all fine.
Things I tried already:
I have 3D sound disabled on the audio files
on the AudioSource, I have Bypass Effects, ByPass Listener Effects and Bypass Reverb Zones all set to 'true'
Doppler Level is set to 0
A while ago this was all good, and it may have happened when I updated to Unity 4.5.4 and XCode 6.0.1.
But I can't say that for sure.
Any ideas what that could be?
found it!
The problem was that in the Audio Settings 'Volume' was set 100 for some strange reason.
So - on the MAC the volume was set to small that's why it played ok - but on the iPhone it tried playing the loud sound so the speakers just went mad....

IOS app - bluetooth audio enabling

I'm working on an IOS 6 app that's currently in development. The app has about 5-6 snippets of audio that play at various stages, currently when the device is paired with some bluetooth speakers (e.g. in a car) the audio does not play through the speakers.
Does anyone know what's involved with making this app work with paired bluetooth speakers? My initial assumption was that it wouldn't need anything extra done, it would just work. I had thought bluetooth paired speakers worked like as if you'd plugged in speakers directly into the device, all audio was routed through the speakers as long as they were paired.
This doesn't appear to be the case though.
I think you have to place an MPVolumeView somewhere in your interface, and enable the showsRouteButton property, then users can use that button to change the audio route to Bluetooth. You can also disable the showsVolumeSlider property if you don't need the volume slider.

Is it possible to record actual sound on the simulator using mic

Is it possible record the actual sound on the simulator using the mic.
I have created the recorder which record the sound in simulator but not recording the actual audio its just null(empty) audio.
The old answer for this question is now incorrect; the iOS Simulator now supports audio input/recording.
Pic below related: where you set your audio input device (defaults to your system default)
Also be warned, some online Apple dev docs still say audio input is unsupported by the simulator ("as of 8.2") even though it is with newer versions...
Edit: Screenshot from OS X 10.12 (Sierra), Xcode 9.1 (function is also available in later Xcode 8, > 8.2)
iOS Simulator does not support audio recording, you should use real device to test.
Here you can read about Limitations of Testing in iOS Simulator
Hardware Limitations While most of the functionality of iOS devices
can be simulated in iOS Simulator, there are some hardware features
that must be tested directly on a device. The hardware features that
cannot be simulated are:
Accelerometer
Gyroscope
Camera
Proximity Sensor
Microphone Input

Is it possible to play sound from one iOS device to another?

I'd like to somehow play music from one iOS device simultaneously on another, sort of like AirPlay, but from device to device.
It seems that by leveraging existing BT tech I should be able to make this happen, but I just haven't seen any examples nor have I read anything that suggests it's possible.
Check the following threads which might help to answer your question.
iOS Stream Audio from one iOS Device to Another
How do I stream AVAsset audio wirelessly form one iOS device to another?

Resources