Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off sound in iPhone Simulator

Is there an option to turn off the sound on the iPhone Simulator? Or to adjust the volume?

like image 224
marko Avatar asked Jul 07 '10 14:07

marko


People also ask

How do I turn on VoiceOver on iPhone simulator?

To start VoiceOver, go to Settings → Accessibility → VoiceOver. Refer to the "Before you start" section on mobile screen reader basics. In order to save time while testing, the shortcut for turning VoiceOver on and off is to triple-press the iPhone/iPad Home button .

How do you turn off sound effects on iPhone?

Open the Settings app. Tap on Sounds & Haptics. Toggle Keyboard Clicks off.

Does notification work on simulator?

If your target platform is Android, you can test a push notification on an emulator if the emulator target uses a version of Google APIs to receive the push notifications.


2 Answers

Partial Success - There are no good options

The iPhone Simulator selects the currently selected output at launch. Using Soundflower plugin and sending the audio to nowhere I started the iPhone Simulator. If you then switch to a different, working, output the simulator will remain 'muted' until you restart the simulator. So in general, you can attempt to trick the simulator to output to a dead end output.

Experimental setup - A sample video player

I'm working on a solution to this problem and as a first step created a demonstration video player app. You can download VideoPlayer from GitHub for your own experiments.

First Attempt - Use a 3rd party app to mute it

Tried using Audio Hijack Pro by Rogue Amoeba to hijack the audio stream and mute it. This didn't work and crashes the simulator. Contacted support and they reported that iPhone Simulator does some things that prevent them from hijacking the audio. I also looked into Soundflower and Jack.

Second Attempt - In-app mute

I was thinking maybe you could make a debug option where when in the app and on the simulator sound would be muted. However, within an app, only private APIs have the power to mute or reduce volume for the device. In the book iPhone Open Application Development Chapter 6, Example "What's My Volume' gives sample code for manipulating system-wide sound through the AVSystemController. It might be fun to explore this route, but to make it into a weaponized tool would require a lot of trouble since you need to compile against private headers.

Idea Three

Find a command-line option to pass to the Springboard or iPhone Simulator that will mute sound, or re-enable the volume control within the simulator, and of course be able to still launch the debugger.

Enhancement Request

I filed an Apple Bug Report enhancement request for both iPhone Simulator volume control, request 13428429, and per application volume control in Mac OS X, request 13428420. If you want these features, please file your own bug.

like image 147
Cameron Lowell Palmer Avatar answered Oct 09 '22 11:10

Cameron Lowell Palmer


I ran into this -- my (working) music audio was being routed through the iOS simulator before reaching my headphones, making the music tinny and low-quality. This made developing in the sim really annoying. Fortunately there's an easy fix:

  • In the simulator, route the incoming sound from your Mac's microphone
  • Still in the simulator, route the outgoing audio through your Mac's speakers, or any other audio channel you aren't using

Changing the incoming audio route:

Changing the outgoing audio route:

like image 32
Dominic Holmes Avatar answered Oct 09 '22 09:10

Dominic Holmes