Built-in audio player user interface on iphone?

My boss seems to think that there is a way to play audio files through the built-in QT interface, which comes up with a modal interface, just like the structure of the address book.

In addition, the mail application displays a QT modal player for playing attached audio files, and then hides when it is done.

I spent 2 hours of research, and I can not find any ready-made interface for playing sound. I understand that I can do this with help AVAudioPlayer, but it still needs to create a user interface, and that’s good, but we are looking for visual familiarity and consistency.

I just found it MPMusicPlayerController, but it looks like it only plays itunes libraries, not media from file paths.

So, is there an audio player built-in user interface?

+3
source share
1 answer

MPMoviePlayerController can also be used to play audio files (although this is 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 the Apple Documentation and more details.

+3
source

Source: https://habr.com/ru/post/1715203/


All Articles