10
WARNING:  40: ERROR: couldn't get default input device, ID = 0, err = 0!

I ran into this error message (/crash) as I tried using the iOS simulator (they all seem to give the same error)- running on an iPhone works just fine.

The problem is somehow related to the sound parts, as when they're commented out, it works. The code is nothing unusual, but I'm sure someone will ask to see it anyway:

_flipSound = [SKAction playSoundFileNamed:@"flip.wav" waitForCompletion:NO];
_successSound = [SKAction playSoundFileNamed:@"success2.wav" waitForCompletion:NO];
_failureSound = [SKAction playSoundFileNamed:@"failure2.wav" waitForCompletion:NO];

and in places where the sound is played, it looks e.g. like this:

if (self.blockType == 3){
    [self runAction:[SoundStore sharedStore].successSound];
} else {
    [self runAction:[SoundStore sharedStore].failureSound];
}
Cesar
  • 2,027
  • 2
  • 18
  • 29

3 Answers3

12

You may need to reset your System sound preferences by toggling "Play user interface sound effects" checkbox in System Preferences > Sound > Sound Effects

sound-not-working-in-iphone-simulator

or possibly adjusting your audio input device to something the simulator likes.

simulator-crashes-on-aqmeiomanger

I am having no problem playing back .wav files in the Simulator using Actions like yours above with the sound Actions as properties of the SKScene object. So alternately there could be an issue in your SoundStore object.

Community
  • 1
  • 1
rebusB
  • 518
  • 5
  • 19
  • 1
    One of the answers there hits close to home 'My mac mini don't have an internal microphone,the Setting->sound->input list is empty. It worked when I insert an external one .' I don't have an external mic handy but I'm going to guess that's the solution. – Cesar Jun 01 '16 at 22:11
  • I think people have just plugged anything into the mic jack (eg. headphones) to trick the system... but either way, did it work? – rebusB Jun 06 '16 at 15:49
  • 1
    Yeah, it works. Stupidest bug I've encountered so far! – Cesar Jun 07 '16 at 18:45
5

Killing the simulator completely (pressing cmd+Q) then re-running the app fixed it for me! Shrug.

CSawy
  • 904
  • 2
  • 14
  • 25
1

Looks like a sound input device (aka microphone) is not prensent on the simulator host (aka computer). Mac Minis & Pros are usually bereft of a microphone. Are you using one of them?

Try attaching a bluetooth/wired headset with microphone, and re-run the simulator. It should make the error go away.

user3582881
  • 79
  • 1
  • 2