Don’t use [AVAudioPlayer pause] « Tonny Xu
...Life is like a box of chocolates,
you never know what you’re gonna get...

AVAudioPlayer is providing a very convenient way to play iPhone supported audio file. Especially, if you want to implement fast forward and rewind, AVAudioPlayer is the best choice.

But I just found an odd problem. If I use [AVAudioPlayer pause] method, next time if I invoke [AVAudioPlayer play], it had no responde. But after I changed pause to stop, it worked fine. The problem looks like it somewhere inside AVAudioPlayer to control the AudioQueue Object to resume playing. Whatever, by using [AVAudioPlayer stop], you can archive the same goal as [AVAudioPlayer pause] do, I mean FFW and RWD.

BTW, the document said, pause will return YES/NO, but clearly, it is a no return value instance method. The guy who is responsible for this method might copied the same comment from play!

Picture 1

What a joke. This line was there since iPhone 2.2, and is still there in 3.0b5. Didn’t there anybody reported this problem? Should I fire a bug?

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • QQ书签
  • StumbleUpon
  • Technorati
  • 豆瓣

Comments
No Responses

Leave a Reply