views:

557

answers:

1

My boss seems to think there's a way to play audio files via a built-in QT interface that comes up with a modal UI, much like address book framework does.

Also, the mail app pops up a QT modal player to play attached audio files and then hides itself when done.

I've done a good 2 hours of research and I cannot find any pre-built UI for playing audio. I understand that I can do it via AVAudioPlayer, but that still requires I build a custom UI, which is fine, but we're looking for visual familiarity and consistency.

I just now found MPMusicPlayerController, but it appears to only play itunes media, not media from file paths.

So, is there a pre-built audio player UI?

+3  A: 

MPMoviePlayerController can also be used to play audio files (although it's not recommended):

MPMoviePlayerController *mPlayer = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL URLWithString:@"http://www.freeaudioclips.com/music1/Sound_Effects/austinmail.wav"]];
// Show Audio player just to test it out
if (mPlayer)
{
    [mPlayer play];
}

Read Apple's Documentation and for more details.

Brenden
Just curious .. why is it not recommended to use the MPMoviePlayerController?
St3fan