Tuesday, April 10, 2012

AVPlayer audio problems?

I'm finally working on an iphone app.  Yes, welcome to 2008!  And this one goes out to anyone who can't get their audio to play on their device, but it will work on simulators!  Fun!

Grrrrrr.

So here's the magic line of objective c that will get your video to play sound on a device.  Are you ready?  Here goes:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:NULL];

I'm staring at this line of code.  It appears to say that any errors with audio, ignore them.  So now your audio will work.  Yay, Apple.  This is the future of app developement?